Skip to content

Commit

Permalink
Ran update-jikan (#11)
Browse files Browse the repository at this point in the history
* Ran update-jikan
* Update to php ^8.2
* Updated rector config
* Update workflow
  • Loading branch information
janvernieuwe authored Apr 15, 2024
1 parent 0659e80 commit 0e39d3f
Show file tree
Hide file tree
Showing 686 changed files with 52,190 additions and 17,376 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/grumphp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.0', '8.1']
php-versions: ['8.2', '8.3']
composer-options: ['']
composer-versions: ['composer:v2']
fail-fast: false
Expand Down
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8",
"php": "^8.2",
"ext-json": "*",
"jane-php/open-api-runtime": "^7.3"
"jane-php/open-api-runtime": "^7.6.1",
"symfony/http-kernel": "^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.11",
"jane-php/open-api-3": "^7.3",
"jane-php/open-api-3": "^7.6.1",
"php-http/guzzle7-adapter": "^1.0",
"phpro/grumphp": "^1.13",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.14.2",
"rector/rector": "^1.0.4",
"squizlabs/php_codesniffer": "^3.7"
},
"autoload": {
Expand All @@ -36,13 +37,16 @@
"config": {
"sort-packages": true,
"allow-plugins": {
"phpro/grumphp": true
"phpro/grumphp": true,
"php-http/discovery": true
}
},
"scripts": {
"update-jikan": [
"rm -rf src/*",
"php vendor/bin/jane-openapi generate --config-file=config/jikan.php",
"find ./src/ -type f -name \"*Normalizer.php\" -exec sed -i 's/public function denormalize($data, $type, $format = null, array $context = \\[\\])/public function denormalize($data, $type, $format = null, array $context = \\[\\]):mixed/g' {} \\;",
"find ./src/ -type f -name \"*Normalizer.php\" -exec sed -i 's/public function normalize($object, $format = null, array $context = \\[\\])/public function normalize($object, $format = null, array $context = \\[\\]):array|\\\\ArrayObject|bool|float|int|string|null/g' {} \\;",
"php vendor/bin/php-cs-fixer -q --allow-risky=yes --config=config/.php-cs-fixer.dist.php fix",
"php vendor/bin/rector --no-diffs --clear-cache --config=config/rector.php",
"php vendor/bin/php-cs-fixer -q --allow-risky=yes --config=config/.php-cs-fixer.dist.php fix",
Expand Down
43 changes: 8 additions & 35 deletions config/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,14 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
use Rector\CodeQuality\Rector\New_\NewStaticToNewSelfRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Php80\Rector\FunctionLike\UnionTypesRector;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector;
use Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
return RectorConfig::configure()
->withPreparedSets(codeQuality: true, codingStyle: true)
->withAttributesSets(symfony: true)
->withPhpSets(php82: true)
->withPaths([
__DIR__ . '/../src',
]);

$rectorConfig->sets([
SetList::PHP_70,
SetList::PHP_71,
SetList::PHP_72,
SetList::PHP_73,
SetList::PHP_74,
SetList::PHP_80,
SetList::PHP_81,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::NAMING,
]);

$rectorConfig->rules([
ReturnTypeDeclarationRector::class,
UnionTypesRector::class,
TypedPropertyRector::class,
ReturnTypeFromStrictNativeCallRector::class,
ReturnTypeFromStrictScalarReturnExprRector::class,
NewStaticToNewSelfRector::class,
]);

$rectorConfig->importNames();
};
])
->withImportNames()
->withRootFiles();
Loading

0 comments on commit 0e39d3f

Please sign in to comment.