Skip to content

Commit

Permalink
Merge pull request #2 from veewee/PHP82
Browse files Browse the repository at this point in the history
Add PHP82 + PSL2 Support
  • Loading branch information
veewee authored Nov 25, 2022
2 parents 53f7d14 + 6847c36 commit 4510fe5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1']
php-versions: ['8.1', '8.2']
composer-options: ['']
composer-versions: ['composer:v2']
fail-fast: false
Expand All @@ -31,7 +31,7 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
run: composer update --prefer-dist --no-progress --ignore-platform-req=php+ ${{ matrix.composer-options }}
- name: Build flex files
run: php scripts/build-flex.php
- name: Check if flex files are up to date
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"sort-packages": true,
"allow-plugins": {
"phpro/grumphp-shim": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"symfony/flex": true
}
},
"extra": {
Expand All @@ -34,6 +35,6 @@
}
},
"require-dev": {
"azjezz/psl": "^1.9"
"azjezz/psl": "^2.1"
}
}
11 changes: 6 additions & 5 deletions scripts/build-flex.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Psl\Collection\Map;
use Psl\File\WriteMode;
use function Psl\Dict\reindex;
use function Psl\Filesystem\read_directory;
use function Psl\Filesystem\read_file;
use function Psl\Filesystem\write_file;
use function Psl\File\read;
use function Psl\File\write;
use function Psl\Iter\reduce_with_keys;
use function Psl\Json\encode;
use function Psl\Str\replace;
Expand All @@ -22,7 +23,7 @@


$placeFileInline = static fn(string $file): array => [
'contents' => explode("\n", read_file($file)),
'contents' => explode("\n", read($file)),
'executable' => false,
];

Expand Down Expand Up @@ -68,13 +69,13 @@
$recipesDir . '/' . replace($package, '/', '.') . '.' . $version . '.json';

$writeJson = static function (string $file, array $contents): void {
write_file($file, encode(
write($file, encode(
[
'WARNING' => 'This file is auto-generated and may only be changed by computers!',
...$contents,
],
true
));
), WriteMode::TRUNCATE);
};

$index = [];
Expand Down

0 comments on commit 4510fe5

Please sign in to comment.