phpcs phpcbf

This commit is contained in:
2026-01-23 18:36:36 -08:00
parent ae5fa27b7d
commit 38f706f0f6
6 changed files with 540 additions and 529 deletions

View File

@@ -13,7 +13,8 @@
"cakephp/migrations": "^4.0.0", "cakephp/migrations": "^4.0.0",
"phpstan/phpstan": "^2.1", "phpstan/phpstan": "^2.1",
"dereuromark/composer-prefer-lowest": "^0.1.10", "dereuromark/composer-prefer-lowest": "^0.1.10",
"cakedc/cakephp-phpstan": "^4.1" "cakedc/cakephp-phpstan": "^4.1",
"fig-r/psr2r-sniffer": "^2.7"
}, },
"suggest": { "suggest": {
"dereuromark/cakephp-geo": "^3.2" "dereuromark/cakephp-geo": "^3.2"
@@ -29,5 +30,18 @@
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/", "Cake\\Test\\": "vendor/cakephp/cakephp/tests/",
"TestApp\\": "tests/test_app/src/" "TestApp\\": "tests/test_app/src/"
} }
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false
}
},
"scripts": {
"cs-check": "vendor/bin/phpcs --colors --parallel=16",
"cs-fix": "vendor/bin/phpcbf --colors --parallel=16",
"lowest": "validate-prefer-lowest",
"lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json",
"stan": "phpstan analyze"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -3,43 +3,42 @@ declare(strict_types=1);
use Migrations\AbstractMigration; use Migrations\AbstractMigration;
class InitialAddressesDynamicForeignKey extends AbstractMigration class InitialAddressesDynamicForeignKey extends AbstractMigration {
{
/** /**
* Up Method. * Up Method.
* *
* More information on this method is available here: * More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method * https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
* @return void * @return void
*/ */
public function up(): void public function up(): void {
{ $this->table('addresses')
$this->table('addresses') ->addColumn('foreign_key', 'string', [
->addColumn('foreign_key', 'string', [ 'limit' => 45,
'limit' => 45, 'null' => true,
'null' => true, 'default' => null,
'default' => null, ])
]) ->addColumn('model', 'string', [
->addColumn('model', 'string', [ 'limit' => 255,
'limit' => 255, 'null' => true,
'null' => true, 'default' => null,
'default' => null, ])
]) ->update();
->update(); }
}
/** /**
* Down Method. * Down Method.
* *
* More information on this method is available here: * More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method * https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
* @return void * @return void
*/ */
public function down(): void public function down(): void {
{ $this->table('addresses')
$this->table('addresses') ->removeColumn('foreign_key')
->removeColumn('foreign_key') ->removeColumn('model')
->removeColumn('model') ->save();
->save(); }
}
} }

View File

@@ -3,7 +3,5 @@
// The following configs can be globally configured, copy the array content over to your ROOT/config // The following configs can be globally configured, copy the array content over to your ROOT/config
return [ return [
'CakeAddresses' => [ 'CakeAddresses' => [],
],
]; ];

View File

@@ -1,14 +1,15 @@
<?php <?php
use Cake\Routing\Route\DashedRoute; use Cake\Routing\Route\DashedRoute;
$routes->plugin( $routes->plugin(
'CakeAddresses', 'CakeAddresses',
['path' => '/address-manager'], ['path' => '/address-manager'],
function ($routes) { function ($routes) {
$routes->setRouteClass(DashedRoute::class); $routes->setRouteClass(DashedRoute::class);
$routes->connect('/addresses', ['controller' => 'Addresses', 'action' => 'index']); $routes->connect('/addresses', ['controller' => 'Addresses', 'action' => 'index']);
$routes->connect('/addresses/view/{id}', ['controller' => 'Addresses', 'action' => 'view', ], ['id' => '\d+', 'pass' => ['id']]); $routes->connect('/addresses/view/{id}', ['controller' => 'Addresses', 'action' => 'view'], ['id' => '\d+', 'pass' => ['id']]);
$routes->connect('/addresses/edit/{id}', ['controller' => 'Addresses', 'action' => 'update'], ['id' => '\d+', 'pass' => ['id']]); $routes->connect('/addresses/edit/{id}', ['controller' => 'Addresses', 'action' => 'update'], ['id' => '\d+', 'pass' => ['id']]);
$routes->connect('/addresses/add', ['controller' => 'Addresses', 'action' => 'add']); $routes->connect('/addresses/add', ['controller' => 'Addresses', 'action' => 'add']);
} },
); );

View File

@@ -9,7 +9,7 @@
<exclude-pattern>/tests/test_files/</exclude-pattern> <exclude-pattern>/tests/test_files/</exclude-pattern>
<exclude-pattern>/tests/test_app/</exclude-pattern> <exclude-pattern>/tests/test_app/</exclude-pattern>
<rule ref="PSR2R"/> <rule ref="vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml"/>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"> <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/config/Migrations/*</exclude-pattern> <exclude-pattern>*/config/Migrations/*</exclude-pattern>