Skip to content

Commit

Permalink
PHP 8.4 support (#1)
Browse files Browse the repository at this point in the history
* PHP 8.4 support

* PHP Linting (Pint)

* PHP 8.4 support

* Better workflow

---------

Co-authored-by: SRWieZ <[email protected]>
  • Loading branch information
SRWieZ and SRWieZ authored Oct 17, 2024
1 parent 0d89de9 commit bdd0f48
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
tools: composer:v2

- name: Copy .env
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Tests

on:
pull_request: ~
pull_request:
push:
branches:
- main
Expand All @@ -10,29 +10,37 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3]
php: [8.2, 8.3, 8.4]

name: Test with php ${{ matrix.php }} on ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ matrix.os }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
# coverage: xdebug

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install --dev --no-interaction --prefer-dist --optimize-autoloader
run: composer update --no-interaction --prefer-dist

- name: Run tests
run: ./vendor/bin/pest
2 changes: 1 addition & 1 deletion src/SVGTinyPS.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function __construct($xmlText)
{
$this->xmlText = $xmlText;

$this->dom = new DOMDocument();
$this->dom = new DOMDocument;
$this->dom->loadXML($this->xmlText);

$this->svg = $this->dom->getElementsByTagName('svg')->item(0);
Expand Down

0 comments on commit bdd0f48

Please sign in to comment.