Skip to content

Commit

Permalink
Use shim package (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored Jan 9, 2024
1 parent 13fba7e commit 92552af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
- os: windows-latest
description: 'on Windows'
php-version: '8.3'
- os: ubuntu-latest
description: 'with shim package'
php-version: '8.3'
use-shim-package: true
- os: ubuntu-latest
php-version: '8.4'
composer_flags: '--ignore-platform-reqs'
Expand All @@ -48,9 +44,6 @@ jobs:
extensions: none, curl, dom, json, mbstring, opcache, openssl, simplexml, tokenizer, xml, xmlwriter
coverage: none

- if: ${{ matrix.use-shim-package }}
run: sed -i 's#friendsofphp/php-cs-fixer#php-cs-fixer/shim#g' composer.json

- run: composer update --no-progress ${{ matrix.composer_flags }}

- run: composer verify
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": "^7.4 || ^8.0",
"kubawerlos/php-cs-fixer-custom-fixers": "^3.18",
"friendsofphp/php-cs-fixer": "^3.42"
"php-cs-fixer/shim": "^3.42"
},
"require-dev": {
"phpunit/phpunit": "^9.5.19"
Expand Down
12 changes: 5 additions & 7 deletions dev/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

$phar = __DIR__ . '/../vendor/php-cs-fixer/shim/php-cs-fixer.phar';

if (file_exists($phar)) {
$pharLoaded = Phar::loadPhar($phar, 'php-cs-fixer.phar');
if (!$pharLoaded) {
exit(sprintf('Phar "%s" not loaded!' . PHP_EOL, $phar));
}

require_once 'phar://php-cs-fixer.phar/vendor/autoload.php';
$pharLoaded = Phar::loadPhar($phar, 'php-cs-fixer.phar');
if (!$pharLoaded) {
exit(sprintf('Phar "%s" not loaded!' . PHP_EOL, $phar));
}

require_once 'phar://php-cs-fixer.phar/vendor/autoload.php';

0 comments on commit 92552af

Please sign in to comment.