Skip to content

Commit

Permalink
Merge pull request #182 from Aeliot-Tm/composer-require-checker
Browse files Browse the repository at this point in the history
Update composer-require-checker
  • Loading branch information
Aeliot-Tm authored Nov 11, 2024
2 parents b1fc08a + b0da073 commit 7416ea9
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ RUN set -xe; \
chmod +x phive.phar && \
mv phive.phar /usr/local/bin/phive

COPY --from=boxproject/box:latest /box.phar /usr/bin/box
RUN chmod +x /usr/bin/box

WORKDIR /app

COPY composer.* ./
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
php-version: 8.2
ini-values: phar.readonly=0
tools: composer
tools: composer, box
coverage: none

- name: Cache Composer packages
Expand All @@ -45,26 +45,6 @@ jobs:
with:
composer-options: '--no-dev'

- name: Cache tools installed with PHIVE
uses: actions/cache@v4
with:
path: "${{ runner.temp }}/.phive"
key: "os-${{ runner.os }}-php-${{ runner.php-version }}-phive-${{ hashFiles('**/.phive/phars.xml', '**/.phive/trust-gpg-keys.txt') }}"
restore-keys: "os-${{ runner.os }}-php-${{ runner.php-version }}-phive-"

- name: Install PHIVE
uses: szepeviktor/phive@v1
with:
home: "${{ runner.temp }}/.phive"
binPath: "${{ github.workspace }}/tools/phive"

- name: Install PHP tools by PHIVE
uses: szepeviktor/phive-install@v1
with:
home: "${{ runner.temp }}/.phive"
binPath: "${{ github.workspace }}/tools/phive"
trustGpgKeys: '$(cat ./.phive/trust-gpg-keys.txt)'

- name: Build PHAR
run: composer build

Expand Down
16 changes: 2 additions & 14 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-require-checker"
version="^4.12.0"
installed="4.12.0"
location="./tools/composer-require-checker.phar"
copy="true"
/>
<phar name="composer-unused"
version="^0.8.11"
installed="0.8.11"
location="./tools/composer-unused.phar"
copy="true"
/>
<phar name="humbug/box" version="^4.6.2" installed="4.6.2" location="./tools/box.phar" copy="true"/>
<phar name="composer-require-checker" version="^4.13.0" installed="4.13.0" location="./tools/composer-require-checker.phar" copy="true"/>
<phar name="composer-unused" version="^0.8.11" installed="0.8.11" location="./tools/composer-unused.phar" copy="true"/>
<phar name="phpunit" version="^11.2.8" installed="11.2.8" location="./tools/phpunit.phar" copy="true"/>
<phar name="php-cs-fixer" version="^3.60.0" installed="3.60.0" location="./tools/php-cs-fixer.phar" copy="true"/>
<phar name="php-cs-fixer-baseline" version="^2.1.2" installed="2.1.2" location="./tools/pcsf-baseline.phar" copy="true"/>
<phar name="phpstan" version="^1.11.8" installed="1.11.8" location="./tools/phpstan.phar" copy="true"/>
</phive>
2 changes: 1 addition & 1 deletion .phive/trust-gpg-keys.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
033E5F8D801A2F8D,B1B5F6D21AB070E1,2DF45277AEF09A2F,4AA394086372C20A,E82B2FB314E9906E,9204DEE8CAE9C22C,51C67305FFC2E5C0
033E5F8D801A2F8D,B1B5F6D21AB070E1,4AA394086372C20A,E82B2FB314E9906E,9204DEE8CAE9C22C
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@
"require-dev": {
"dg/bypass-finals": "^1.7",
"enlightn/security-checker": "^2.0",
"phpstan/phpstan": "^2.0",
"roave/security-advisories": "dev-latest"
},
"scripts": {
"build": [
"php scripts/box/prepare-config.php",
"tools/box.phar compile --config=scripts/box/config.json"
"box compile --config=scripts/box/config.json"
],
"check-all": [
"@cs-fixer-check",
Expand All @@ -76,12 +77,12 @@
"@phpstan-clear",
"@phpstan-analyse"
],
"phpstan-analyse": "tools/phpstan.phar analyse -c scripts/phpstan/config.neon ",
"phpstan-analyse": "vendor/bin/phpstan analyse -c scripts/phpstan/config.neon ",
"phpstan-baseline": [
"@phpstan-clear",
"@phpstan-analyse --generate-baseline scripts/phpstan/baseline.neon --allow-empty-baseline"
],
"phpstan-clear": "tools/phpstan.phar clear-result-cache -c scripts/phpstan/config.neon",
"phpstan-clear": "vendor/bin/phpstan clear-result-cache -c scripts/phpstan/config.neon",
"phpunit": "tools/phpunit.phar -c scripts/phpunit/phpunit.xml",
"require-check": "tools/composer-require-checker.phar check --config-file=scripts/composer-require-checker/config.json composer.json --output=text",
"unused": "XDEBUG_MODE=off tools/composer-unused.phar unused -c ./scripts/composer-unused/config.php"
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Service/Comment/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function registerPart(string $line, CommentParts $parts): CommentPart
*/
private function splitLines(string $comment): array
{
/** @var string[] $lines */
/** @var list<string> $lines */
$lines = preg_split("/([\r\n]+)/", $comment, -1, \PREG_SPLIT_DELIM_CAPTURE);
$count = \count($lines);
$currentLineIndex = 0;
Expand Down

0 comments on commit 7416ea9

Please sign in to comment.