diff --git a/composer.json b/composer.json index d4d8e28..31d7ace 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "phpmetrics/phpmetrics": "dev-master@dev", "phpstan/phpstan": "0.12.14", "phpunit/phpunit": "*", - "squizlabs/php_codesniffer": "3.5.4", + "squizlabs/php_codesniffer": "4.0.0", "symfony/yaml": "~2.1|~3.0|~4.0" }, "config": { diff --git a/demos/example-ajax.php b/demos/example-ajax.php index 611f702..1e6d945 100644 --- a/demos/example-ajax.php +++ b/demos/example-ajax.php @@ -3,7 +3,6 @@ require_once 'bootstrap.php'; use atk4\ui\App; -use ATK4PHPDebugBar\DebugBar; class User extends \atk4\data\Model { @@ -22,7 +21,7 @@ public function init() $app = new App([ 'title' => 'Agile UI - DebugBar', - 'db' => $db, + 'db' => $db, ]); $app->initLayout('Centered'); @@ -40,8 +39,8 @@ public function init() // Migration : if not exists table create it \atk4\schema\Migration::getMigration($model_user)->migrate(); -$model_user->insert(['name'=>'test 1', 'email'=>'test1@test.it']); -$model_user->insert(['name'=>'test 2', 'email'=>'test2@test.it']); +$model_user->insert(['name' => 'test 1', 'email' => 'test1@test.it']); +$model_user->insert(['name' => 'test 2', 'email' => 'test2@test.it']); $loader = $app->add('Loader'); diff --git a/demos/example-atk4-router.php b/demos/example-atk4-router.php index 59a3546..8110886 100644 --- a/demos/example-atk4-router.php +++ b/demos/example-atk4-router.php @@ -32,7 +32,7 @@ public function init(): void // Migration : if not exists table create it \atk4\schema\Migration::getMigration($model_user)->migrate(); - $model_user->insert(['name'=>'test '.rand(0, 800), 'email'=>'test1@test.it']); + $model_user->insert(['name' => 'test '.rand(0, 800), 'email' => 'test1@test.it']); $loader = $this->app->add('Loader'); @@ -55,7 +55,7 @@ public function init(): void $app = new App([ 'title' => 'Agile UI - DebugBar', - 'db' => \atk4\data\Persistence::connect('sqlite::memory:'), + 'db' => \atk4\data\Persistence::connect('sqlite::memory:'), 'always_run' => false, ]); diff --git a/demos/example-logger.php b/demos/example-logger.php index 32e5dc9..d5eff74 100644 --- a/demos/example-logger.php +++ b/demos/example-logger.php @@ -3,7 +3,6 @@ require_once 'bootstrap.php'; use atk4\ui\App; -use ATK4PHPDebugBar\DebugBar; use Monolog\Handler\StreamHandler; use Monolog\Logger; @@ -12,7 +11,7 @@ $app = new App([ 'title' => 'Agile UI - DebugBar', - 'logger'=> $monolog, + 'logger' => $monolog, ]); $app->initLayout('Centered'); diff --git a/demos/example-persistence.php b/demos/example-persistence.php index f27e59b..eb87093 100644 --- a/demos/example-persistence.php +++ b/demos/example-persistence.php @@ -3,7 +3,6 @@ require_once 'bootstrap.php'; use atk4\ui\App; -use ATK4PHPDebugBar\DebugBar; class User extends \atk4\data\Model { @@ -22,7 +21,7 @@ public function init() $app = new App([ 'title' => 'Agile UI - DebugBar', - 'db' => $db, + 'db' => $db, ]); $app->initLayout('Centered'); @@ -34,10 +33,10 @@ public function init() $model_user = new User($app->db); // Migration : if not exists table create it -(\atk4\schema\Migration::getMigration($model_user))->migrate(); +\atk4\schema\Migration::getMigration($model_user)->migrate(); -$model_user->insert(['name'=>'test 1', 'email'=>'test1@test.it']); -$model_user->insert(['name'=>'test 2', 'email'=>'test2@test.it']); +$model_user->insert(['name' => 'test 1', 'email' => 'test1@test.it']); +$model_user->insert(['name' => 'test 2', 'email' => 'test2@test.it']); $loader = $app->add('Loader'); diff --git a/src/DebugBar.php b/src/DebugBar.php index 3f2f56e..a6d4891 100644 --- a/src/DebugBar.php +++ b/src/DebugBar.php @@ -119,7 +119,7 @@ public function init(): void } /** - * @param DataCollectorInterface $dataCollector + * @param DataCollectorInterface $dataCollector * * @throws DebugBarException */ @@ -226,10 +226,10 @@ public function getDebugBar(): \DebugBar\DebugBar } /** - * @param string $name + * @param string $name + * @return DataCollectorInterface * * @throws DebugBarException - * @return DataCollectorInterface */ public function getCollector(string $name): DataCollectorInterface { @@ -237,8 +237,7 @@ public function getCollector(string $name): DataCollectorInterface } /** - * @param string $name - * + * @param string $name * @return bool */ public function hasCollector(string $name): bool @@ -247,8 +246,7 @@ public function hasCollector(string $name): bool } /** - * @param string $url - * + * @param string $url * @return $this */ public function setAssetsResourcesUrl(string $url) @@ -259,8 +257,7 @@ public function setAssetsResourcesUrl(string $url) } /** - * @param string $path - * + * @param string $path * @return $this */ public function setAssetsResourcesPath(string $path) @@ -294,7 +291,7 @@ public function addATK4LoggerCollector(): void } /** - * @param Persistence\SQL|null $persistence + * @param Persistence\SQL|null $persistence * * @throws DebugBarException */ diff --git a/tests/DebugBarTest.php b/tests/DebugBarTest.php index ebd60a5..13af12f 100644 --- a/tests/DebugBarTest.php +++ b/tests/DebugBarTest.php @@ -42,6 +42,7 @@ public function testGetDebugBar_AppDynamicMethods() /** * Only for increase coverage, cover 1 line of code. + * * @runInSeparateProcess */ public function testSendMessagesViaHeaders() diff --git a/tests/DemosTest.php b/tests/DemosTest.php index aac7b9e..9f5ce25 100755 --- a/tests/DemosTest.php +++ b/tests/DemosTest.php @@ -16,6 +16,7 @@ public function tearDown(): void /** * @runInSeparateProcess + * * @dataProvider dataProviderTestDemos */ public function testDemos($file)