phpcs phpcbf
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
"cakephp/migrations": "^4.0.0",
|
||||
"phpstan/phpstan": "^2.1",
|
||||
"dereuromark/composer-prefer-lowest": "^0.1.10",
|
||||
"cakedc/cakephp-phpstan": "^4.1"
|
||||
"cakedc/cakephp-phpstan": "^4.1",
|
||||
"fig-r/psr2r-sniffer": "^2.7"
|
||||
},
|
||||
"suggest": {
|
||||
"dereuromark/cakephp-geo": "^3.2"
|
||||
@@ -29,5 +30,18 @@
|
||||
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
use Migrations\AbstractMigration;
|
||||
|
||||
class InitialAddresses extends AbstractMigration
|
||||
{
|
||||
class InitialAddresses extends AbstractMigration {
|
||||
|
||||
/**
|
||||
* Up Method.
|
||||
*
|
||||
@@ -12,8 +12,7 @@ class InitialAddresses extends AbstractMigration
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
public function up(): void {
|
||||
$this->table('addresses')
|
||||
->addColumn('address_name', 'string', [
|
||||
'default' => null,
|
||||
@@ -315,7 +314,7 @@ class InitialAddresses extends AbstractMigration
|
||||
],
|
||||
[
|
||||
'name' => 'country_continent',
|
||||
]
|
||||
],
|
||||
)
|
||||
->addIndex(
|
||||
[
|
||||
@@ -323,7 +322,7 @@ class InitialAddresses extends AbstractMigration
|
||||
],
|
||||
[
|
||||
'name' => 'country_subregion',
|
||||
]
|
||||
],
|
||||
)
|
||||
->create();
|
||||
|
||||
@@ -434,7 +433,7 @@ class InitialAddresses extends AbstractMigration
|
||||
],
|
||||
[
|
||||
'name' => 'country_region',
|
||||
]
|
||||
],
|
||||
)
|
||||
->create();
|
||||
|
||||
@@ -482,7 +481,7 @@ class InitialAddresses extends AbstractMigration
|
||||
],
|
||||
[
|
||||
'name' => 'subregion_continent',
|
||||
]
|
||||
],
|
||||
)
|
||||
->create();
|
||||
|
||||
@@ -566,33 +565,32 @@ class InitialAddresses extends AbstractMigration
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
public function down(): void {
|
||||
$this->table('cities')
|
||||
->dropForeignKey(
|
||||
'country_id'
|
||||
'country_id',
|
||||
)
|
||||
->dropForeignKey(
|
||||
'state_id'
|
||||
'state_id',
|
||||
)->save();
|
||||
|
||||
$this->table('countries')
|
||||
->dropForeignKey(
|
||||
'subregion_id'
|
||||
'subregion_id',
|
||||
)
|
||||
->dropForeignKey(
|
||||
'region_id'
|
||||
'region_id',
|
||||
)
|
||||
->save();
|
||||
|
||||
$this->table('states')
|
||||
->dropForeignKey(
|
||||
'country_id'
|
||||
'country_id',
|
||||
)->save();
|
||||
|
||||
$this->table('subregions')
|
||||
->dropForeignKey(
|
||||
'region_id'
|
||||
'region_id',
|
||||
)->save();
|
||||
|
||||
$this->table('addresses')->drop()->save();
|
||||
@@ -602,4 +600,5 @@ class InitialAddresses extends AbstractMigration
|
||||
$this->table('states')->drop()->save();
|
||||
$this->table('subregions')->drop()->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
use Migrations\AbstractMigration;
|
||||
|
||||
class InitialAddressesDynamicForeignKey extends AbstractMigration
|
||||
{
|
||||
class InitialAddressesDynamicForeignKey extends AbstractMigration {
|
||||
|
||||
/**
|
||||
* Up Method.
|
||||
*
|
||||
@@ -12,8 +12,7 @@ class InitialAddressesDynamicForeignKey extends AbstractMigration
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
public function up(): void {
|
||||
$this->table('addresses')
|
||||
->addColumn('foreign_key', 'string', [
|
||||
'limit' => 45,
|
||||
@@ -35,11 +34,11 @@ class InitialAddressesDynamicForeignKey extends AbstractMigration
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
public function down(): void {
|
||||
$this->table('addresses')
|
||||
->removeColumn('foreign_key')
|
||||
->removeColumn('model')
|
||||
->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,5 @@
|
||||
// The following configs can be globally configured, copy the array content over to your ROOT/config
|
||||
|
||||
return [
|
||||
'CakeAddresses' => [
|
||||
|
||||
],
|
||||
'CakeAddresses' => [],
|
||||
];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Cake\Routing\Route\DashedRoute;
|
||||
|
||||
$routes->plugin(
|
||||
@@ -7,8 +8,8 @@ $routes->plugin(
|
||||
function ($routes) {
|
||||
$routes->setRouteClass(DashedRoute::class);
|
||||
$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/add', ['controller' => 'Addresses', 'action' => 'add']);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<exclude-pattern>/tests/test_files/</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">
|
||||
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
|
||||
|
||||
Reference in New Issue
Block a user