mohammad-alavi / apiato-rector
A collection of Rectors for the Apiato meta-framework.
dev-latest
2025-04-07 10:03 UTC
Requires
- php: ^8.2
- illuminate/routing: ^10.0 || ^11.0 || ^12.0
- webmozart/assert: ^1.11
Requires (Dev)
- brianium/paratest: ^7.3
- fakerphp/faker: ^1.19.1
- friendsofphp/php-cs-fixer: ^3.8.0
- mockery/mockery: ^1.4.4
- php-standard-library/psalm-plugin: ^2.3
- phpmd/phpmd: @stable
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.0.1
- psalm/plugin-laravel: ^3.0
- psalm/plugin-mockery: ^1.2
- psalm/plugin-phpunit: ^0.19.2
- rector/rector: ^2.0
- roave/security-advisories: dev-latest
- vimeo/psalm: ^6.0.0
This package is auto-updated.
Last update: 2025-04-07 10:03:53 UTC
README
Apiato Rector
A set of Rector rules to automatically upgrade your Apiato project to the latest version.
Installation
composer require --dev mohammad-alavi/apiato-rector dev-latest
Also ensure you have Rector itself installed:
composer require --dev rector/rector
Usage
php vendor/bin/rector
v12 to v13 Rules
TransformMethodToResponseFacadeRector
Converts $this->transform(...)
calls to Response::create(...)
.
use MohammadAlavi\ApiatoRector\Rules\TransformMethodToResponseFacadeRector; use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPaths([ __DIR__ . '/app', __DIR__ . '/config', ]) ->withImportNames(true, false, false, true) ->withRules([ TransformMethodToResponseFacadeRector::class, ]);
RefactorHttpExceptionRector
Refactor exception classes to the new HTTP exception signature.
use MohammadAlavi\ApiatoRector\Rules\RefactorHttpExceptionRector; use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPaths([ __DIR__ . '/app', __DIR__ . '/config', ]) ->withImportNames(true, false, false, true) ->withConfiguredRule(RefactorHttpExceptionRector::class, [ 'parent_class' => \App\Ship\Parents\Exceptions\HttpException::class, ]);