From f666c2f7784b79d002ed463a78ed053d594f2810 Mon Sep 17 00:00:00 2001 From: May Date: Thu, 20 Oct 2022 21:39:42 +0200 Subject: [PATCH 01/13] Update Namespace --- bin/cake.php | 2 +- composer.json | 8 ++--- config/app.php | 2 +- src/Application.php | 2 +- src/Command/ConsoleCommand.php | 2 +- src/Console/Installer.php | 2 +- src/Controller/AppController.php | 2 +- src/Controller/ArticlesController.php | 6 ++-- src/Controller/ErrorController.php | 2 +- src/Controller/PagesController.php | 2 +- src/Controller/TagsController.php | 6 ++-- src/Controller/UsersController.php | 6 ++-- src/Model/Entity/Article.php | 6 ++-- src/Model/Entity/ArticlesTag.php | 6 ++-- src/Model/Entity/Tag.php | 4 +-- src/Model/Entity/User.php | 4 +-- src/Model/Table/ArticlesTable.php | 34 +++++++++---------- src/Model/Table/ArticlesTagsTable.php | 32 ++++++++--------- src/Model/Table/TagsTable.php | 30 ++++++++-------- src/Model/Table/UsersTable.php | 30 ++++++++-------- src/Policy/ArticlePolicy.php | 12 +++---- src/Policy/ArticleTablePolicy.php | 4 +-- src/View/AjaxView.php | 2 +- src/View/AppView.php | 2 +- templates/Articles/add.php | 4 +-- templates/Articles/edit.php | 4 +-- templates/Articles/index.php | 4 +-- templates/Articles/view.php | 4 +-- templates/Error/error400.php | 2 +- templates/Error/error500.php | 2 +- templates/Pages/home.php | 2 +- templates/Tags/add.php | 4 +-- templates/Tags/edit.php | 4 +-- templates/Tags/index.php | 4 +-- templates/Tags/view.php | 4 +-- templates/Users/add.php | 4 +-- templates/Users/edit.php | 4 +-- templates/Users/index.php | 4 +-- templates/Users/view.php | 4 +-- templates/element/flash/default.php | 2 +- templates/element/flash/error.php | 2 +- templates/element/flash/success.php | 2 +- templates/email/html/default.php | 2 +- templates/email/text/default.php | 2 +- templates/layout/ajax.php | 2 +- templates/layout/default.php | 2 +- templates/layout/email/html/default.php | 2 +- templates/layout/email/text/default.php | 2 +- templates/layout/error.php | 2 +- tests/Fixture/ArticlesFixture.php | 2 +- tests/Fixture/ArticlesTagsFixture.php | 2 +- tests/Fixture/TagsFixture.php | 2 +- tests/Fixture/UsersFixture.php | 2 +- tests/TestCase/ApplicationTest.php | 4 +-- .../Controller/ArticlesControllerTest.php | 18 +++++----- .../Controller/PagesControllerTest.php | 4 +-- .../Controller/TagsControllerTest.php | 18 +++++----- .../Controller/UsersControllerTest.php | 18 +++++----- .../Model/Table/ArticlesTableTest.php | 10 +++--- .../Model/Table/ArticlesTagsTableTest.php | 12 +++---- tests/TestCase/Model/Table/TagsTableTest.php | 12 +++---- tests/TestCase/Model/Table/UsersTableTest.php | 12 +++---- 62 files changed, 199 insertions(+), 199 deletions(-) diff --git a/bin/cake.php b/bin/cake.php index 320ee36..1e7fd55 100644 --- a/bin/cake.php +++ b/bin/cake.php @@ -4,7 +4,7 @@ require dirname(__DIR__) . '/config/requirements.php'; require dirname(__DIR__) . '/vendor/autoload.php'; -use App\Application; +use MeowBlog\Application; use Cake\Console\CommandRunner; // Build the runner with an application and root executable name. diff --git a/composer.json b/composer.json index a51801a..ccfa03b 100644 --- a/composer.json +++ b/composer.json @@ -31,20 +31,20 @@ }, "autoload": { "psr-4": { - "App\\": "src/", + "MeowBlog\\": "src/", "Tools\\": "plugins/Tools/src/" } }, "autoload-dev": { "psr-4": { - "App\\Test\\": "tests/", + "MeowBlog\\Test\\": "tests/", "Cake\\Test\\": "vendor/cakephp/cakephp/tests/", "Tools\\Test\\": "plugins/Tools/tests/" } }, "scripts": { - "post-install-cmd": "App\\Console\\Installer::postInstall", - "post-create-project-cmd": "App\\Console\\Installer::postInstall", + "post-install-cmd": "MeowBlog\\Console\\Installer::postInstall", + "post-create-project-cmd": "MeowBlog\\Console\\Installer::postInstall", "check": [ "@test", "@cs-check" diff --git a/config/app.php b/config/app.php index ef28038..0693f12 100644 --- a/config/app.php +++ b/config/app.php @@ -48,7 +48,7 @@ * paths for plugins, view templates and locale files respectively. */ 'App' => [ - 'namespace' => 'App', + 'namespace' => 'MeowBlog', 'encoding' => env('APP_ENCODING', 'UTF-8'), 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'), 'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'), diff --git a/src/Application.php b/src/Application.php index 2a23d7a..2688f5c 100644 --- a/src/Application.php +++ b/src/Application.php @@ -14,7 +14,7 @@ * @since 3.3.0 * @license https://opensource.org/licenses/mit-license.php MIT License */ -namespace App; +namespace MeowBlog; use Authentication\AuthenticationService; use Authentication\AuthenticationServiceInterface; diff --git a/src/Command/ConsoleCommand.php b/src/Command/ConsoleCommand.php index 23686aa..059eed4 100644 --- a/src/Command/ConsoleCommand.php +++ b/src/Command/ConsoleCommand.php @@ -14,7 +14,7 @@ * @since 3.0.0 * @license https://opensource.org/licenses/mit-license.php MIT License */ -namespace App\Command; +namespace MeowBlog\Command; use Cake\Command\Command; use Cake\Console\Arguments; diff --git a/src/Console/Installer.php b/src/Console/Installer.php index 8d98c77..773755d 100644 --- a/src/Console/Installer.php +++ b/src/Console/Installer.php @@ -14,7 +14,7 @@ * @since 3.0.0 * @license https://opensource.org/licenses/mit-license.php MIT License */ -namespace App\Console; +namespace MeowBlog\Console; if (!defined('STDIN')) { define('STDIN', fopen('php://stdin', 'r')); diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index de9947b..582c801 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -14,7 +14,7 @@ * @since 0.2.9 * @license https://opensource.org/licenses/mit-license.php MIT License */ -namespace App\Controller; +namespace MeowBlog\Controller; use Burzum\CakeServiceLayer\Service\ServiceAwareTrait; use Cake\Controller\Controller; diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index 7af0a13..7b24309 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -1,15 +1,15 @@
diff --git a/templates/Articles/view.php b/templates/Articles/view.php index 64f4c7b..f468b38 100644 --- a/templates/Articles/view.php +++ b/templates/Articles/view.php @@ -1,7 +1,7 @@
diff --git a/templates/Error/error400.php b/templates/Error/error400.php index 68c0e63..8f78a07 100644 --- a/templates/Error/error400.php +++ b/templates/Error/error400.php @@ -1,6 +1,6 @@ diff --git a/templates/Tags/edit.php b/templates/Tags/edit.php index e60b4fd..632f3b4 100644 --- a/templates/Tags/edit.php +++ b/templates/Tags/edit.php @@ -1,7 +1,7 @@ diff --git a/templates/Tags/index.php b/templates/Tags/index.php index b48cf4f..11d078c 100644 --- a/templates/Tags/index.php +++ b/templates/Tags/index.php @@ -1,7 +1,7 @@
diff --git a/templates/Tags/view.php b/templates/Tags/view.php index 3e17327..bf273f3 100644 --- a/templates/Tags/view.php +++ b/templates/Tags/view.php @@ -1,7 +1,7 @@
diff --git a/templates/Users/add.php b/templates/Users/add.php index 21f6285..7deaa43 100644 --- a/templates/Users/add.php +++ b/templates/Users/add.php @@ -1,7 +1,7 @@
diff --git a/templates/Users/edit.php b/templates/Users/edit.php index c9e9c72..c3eec89 100644 --- a/templates/Users/edit.php +++ b/templates/Users/edit.php @@ -1,7 +1,7 @@
diff --git a/templates/Users/index.php b/templates/Users/index.php index 0ac6918..fd3389d 100644 --- a/templates/Users/index.php +++ b/templates/Users/index.php @@ -1,7 +1,7 @@
diff --git a/templates/Users/view.php b/templates/Users/view.php index 17677fc..6b62dcc 100644 --- a/templates/Users/view.php +++ b/templates/Users/view.php @@ -1,7 +1,7 @@
diff --git a/templates/element/flash/default.php b/templates/element/flash/default.php index 061c700..685e6ba 100644 --- a/templates/element/flash/default.php +++ b/templates/element/flash/default.php @@ -1,6 +1,6 @@ fetch('content'); diff --git a/templates/layout/default.php b/templates/layout/default.php index 41471b1..faf6e45 100644 --- a/templates/layout/default.php +++ b/templates/layout/default.php @@ -11,7 +11,7 @@ * @link https://cakephp.org CakePHP(tm) Project * @since 0.10.0 * @license https://opensource.org/licenses/mit-license.php MIT License - * @var \App\View\AppView $this + * @var \MeowBlog\View\AppView $this */ $cakeDescription = 'CakePHP: the rapid development php framework'; diff --git a/templates/layout/email/html/default.php b/templates/layout/email/html/default.php index 96b0e73..05ded36 100644 --- a/templates/layout/email/html/default.php +++ b/templates/layout/email/html/default.php @@ -11,7 +11,7 @@ * @link https://cakephp.org CakePHP(tm) Project * @since 0.10.0 * @license https://opensource.org/licenses/mit-license.php MIT License - * @var \App\View\AppView $this + * @var \MeowBlog\View\AppView $this */ ?> diff --git a/templates/layout/email/text/default.php b/templates/layout/email/text/default.php index cd51169..a3d4aaf 100644 --- a/templates/layout/email/text/default.php +++ b/templates/layout/email/text/default.php @@ -11,7 +11,7 @@ * @link https://cakephp.org CakePHP(tm) Project * @since 0.10.0 * @license https://opensource.org/licenses/mit-license.php MIT License - * @var \App\View\AppView $this + * @var \MeowBlog\View\AppView $this */ echo $this->fetch('content'); diff --git a/templates/layout/error.php b/templates/layout/error.php index 28c09ba..4af4d16 100644 --- a/templates/layout/error.php +++ b/templates/layout/error.php @@ -11,7 +11,7 @@ * @link https://cakephp.org CakePHP(tm) Project * @since 0.10.0 * @license https://opensource.org/licenses/mit-license.php MIT License - * @var \App\View\AppView $this + * @var \MeowBlog\View\AppView $this */ ?> diff --git a/tests/Fixture/ArticlesFixture.php b/tests/Fixture/ArticlesFixture.php index f8b9e70..6e836e4 100644 --- a/tests/Fixture/ArticlesFixture.php +++ b/tests/Fixture/ArticlesFixture.php @@ -1,7 +1,7 @@ Date: Thu, 20 Oct 2022 21:40:54 +0200 Subject: [PATCH 02/13] Update files with CS-FIX --- src/Controller/ArticlesController.php | 2 +- src/Controller/UsersController.php | 2 ++ src/Model/Entity/Article.php | 1 + src/Model/Entity/User.php | 1 + src/Model/Table/ArticlesTable.php | 12 +++++------- src/Model/Table/ArticlesTagsTable.php | 2 -- src/Model/Table/TagsTable.php | 3 --- src/Model/Table/UsersTable.php | 3 --- src/Policy/ArticlePolicy.php | 2 +- src/Policy/ArticleTablePolicy.php | 3 --- tests/TestCase/ApplicationTest.php | 2 +- tests/TestCase/Controller/ArticlesControllerTest.php | 1 - tests/TestCase/Controller/TagsControllerTest.php | 1 - tests/TestCase/Controller/UsersControllerTest.php | 1 - tests/TestCase/Model/Table/ArticlesTableTest.php | 2 +- tests/TestCase/Model/Table/ArticlesTagsTableTest.php | 2 +- tests/TestCase/Model/Table/TagsTableTest.php | 2 +- tests/TestCase/Model/Table/UsersTableTest.php | 2 +- 18 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index 7b24309..0647d7c 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -130,7 +130,7 @@ public function delete(string $slug) public function tags(...$tags) { $articles = $this->Articles->find('tagged', [ - 'tags' => $tags + 'tags' => $tags, ])->contain(['Tags'])->all(); $this->Authorization->skipAuthorization(); diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index 498d339..a2520b5 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -127,6 +127,7 @@ public function login() // If the user is logged in send them away. if ($result->isValid()) { $target = $this->Authentication->getLoginRedirect() ?? '/home'; + return $this->redirect($target); } if ($this->request->is('post')) { @@ -138,6 +139,7 @@ public function logout() { $this->Authorization->skipAuthorization(); $this->Authentication->logout(); + return $this->redirect(['controller' => 'Users', 'action' => 'login']); } } diff --git a/src/Model/Entity/Article.php b/src/Model/Entity/Article.php index d65d004..10a814a 100644 --- a/src/Model/Entity/Article.php +++ b/src/Model/Entity/Article.php @@ -57,6 +57,7 @@ protected function _getTagString() $str = $tags->reduce(function ($string, $tag) { return $string . $tag->title . ', '; }, ''); + return trim($str, ', '); } } diff --git a/src/Model/Entity/User.php b/src/Model/Entity/User.php index 91e6d68..a4b8d3a 100644 --- a/src/Model/Entity/User.php +++ b/src/Model/Entity/User.php @@ -48,6 +48,7 @@ class User extends Entity protected function _setPassword(string $password) { $hasher = new DefaultPasswordHasher(); + return $hasher->hash($password); } } diff --git a/src/Model/Table/ArticlesTable.php b/src/Model/Table/ArticlesTable.php index 6728086..b5128e0 100644 --- a/src/Model/Table/ArticlesTable.php +++ b/src/Model/Table/ArticlesTable.php @@ -3,7 +3,6 @@ namespace MeowBlog\Model\Table; -use MeowBlog\Model\Entity\Tag; use Cake\Event\EventInterface; use Cake\ORM\Query; use Cake\ORM\RulesChecker; @@ -16,7 +15,6 @@ * * @property \MeowBlog\Model\Table\UsersTable&\Cake\ORM\Association\BelongsTo $Users * @property \MeowBlog\Model\Table\TagsTable&\Cake\ORM\Association\BelongsToMany $Tags - * * @method \MeowBlog\Model\Entity\Article newEmptyEntity() * @method \MeowBlog\Model\Entity\Article newEntity(array $data, array $options = []) * @method \MeowBlog\Model\Entity\Article[] newEntities(array $data, array $options = []) @@ -30,7 +28,6 @@ * @method \MeowBlog\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class ArticlesTable extends Table @@ -117,7 +114,7 @@ public function buildRules(RulesChecker $rules): RulesChecker } /** - * @param EventInterface $event + * @param \Cake\Event\EventInterface $event * @param $entity * @param $options * @return void @@ -136,9 +133,9 @@ public function beforeSave(EventInterface $event, $entity, $options) } /** - * @param Query $query + * @param \Cake\ORM\Query $query * @param array $options - * @return Query + * @return \Cake\ORM\Query */ public function findTagged(Query $query, array $options): Query { @@ -165,7 +162,7 @@ public function findTagged(Query $query, array $options): Query /** * @param string $tagString - * @return array Array of Tag entities + * @return array<\MeowBlog\Model\Entity\Tag> Array of Tag entities */ protected function _buildTags(string $tagString): array { @@ -196,6 +193,7 @@ protected function _buildTags(string $tagString): array foreach ($newTags as $tag) { $out[] = $this->Tags->newEntity(['title' => $tag]); } + return $out; } } diff --git a/src/Model/Table/ArticlesTagsTable.php b/src/Model/Table/ArticlesTagsTable.php index fa691d3..4abdb55 100644 --- a/src/Model/Table/ArticlesTagsTable.php +++ b/src/Model/Table/ArticlesTagsTable.php @@ -3,7 +3,6 @@ namespace MeowBlog\Model\Table; -use Cake\ORM\Query; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; @@ -13,7 +12,6 @@ * * @property \MeowBlog\Model\Table\ArticlesTable&\Cake\ORM\Association\BelongsTo $Articles * @property \MeowBlog\Model\Table\TagsTable&\Cake\ORM\Association\BelongsTo $Tags - * * @method \MeowBlog\Model\Entity\ArticlesTag newEmptyEntity() * @method \MeowBlog\Model\Entity\ArticlesTag newEntity(array $data, array $options = []) * @method \MeowBlog\Model\Entity\ArticlesTag[] newEntities(array $data, array $options = []) diff --git a/src/Model/Table/TagsTable.php b/src/Model/Table/TagsTable.php index 4ed8e08..c2f5863 100644 --- a/src/Model/Table/TagsTable.php +++ b/src/Model/Table/TagsTable.php @@ -3,7 +3,6 @@ namespace MeowBlog\Model\Table; -use Cake\ORM\Query; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; @@ -12,7 +11,6 @@ * Tags Model * * @property \MeowBlog\Model\Table\ArticlesTable&\Cake\ORM\Association\BelongsToMany $Articles - * * @method \MeowBlog\Model\Entity\Tag newEmptyEntity() * @method \MeowBlog\Model\Entity\Tag newEntity(array $data, array $options = []) * @method \MeowBlog\Model\Entity\Tag[] newEntities(array $data, array $options = []) @@ -26,7 +24,6 @@ * @method \MeowBlog\Model\Entity\Tag[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\Tag[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\Tag[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class TagsTable extends Table diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index 5613c63..758bc03 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -3,7 +3,6 @@ namespace MeowBlog\Model\Table; -use Cake\ORM\Query; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; @@ -12,7 +11,6 @@ * Users Model * * @property \MeowBlog\Model\Table\ArticlesTable&\Cake\ORM\Association\HasMany $Articles - * * @method \MeowBlog\Model\Entity\User newEmptyEntity() * @method \MeowBlog\Model\Entity\User newEntity(array $data, array $options = []) * @method \MeowBlog\Model\Entity\User[] newEntities(array $data, array $options = []) @@ -26,7 +24,6 @@ * @method \MeowBlog\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class UsersTable extends Table diff --git a/src/Policy/ArticlePolicy.php b/src/Policy/ArticlePolicy.php index 35e0037..cfce39b 100644 --- a/src/Policy/ArticlePolicy.php +++ b/src/Policy/ArticlePolicy.php @@ -3,8 +3,8 @@ namespace MeowBlog\Policy; -use MeowBlog\Model\Entity\Article; use Authorization\IdentityInterface; +use MeowBlog\Model\Entity\Article; /** * Article policy diff --git a/src/Policy/ArticleTablePolicy.php b/src/Policy/ArticleTablePolicy.php index 5c5c45c..a1eb003 100644 --- a/src/Policy/ArticleTablePolicy.php +++ b/src/Policy/ArticleTablePolicy.php @@ -3,9 +3,6 @@ namespace MeowBlog\Policy; -use MeowBlog\Model\Table\ArticleTable; -use Authorization\IdentityInterface; - /** * Article policy */ diff --git a/tests/TestCase/ApplicationTest.php b/tests/TestCase/ApplicationTest.php index bf79063..43346f3 100644 --- a/tests/TestCase/ApplicationTest.php +++ b/tests/TestCase/ApplicationTest.php @@ -16,13 +16,13 @@ */ namespace MeowBlog\Test\TestCase; -use MeowBlog\Application; use Cake\Error\Middleware\ErrorHandlerMiddleware; use Cake\Http\MiddlewareQueue; use Cake\Routing\Middleware\AssetMiddleware; use Cake\Routing\Middleware\RoutingMiddleware; use Cake\TestSuite\IntegrationTestCase; use InvalidArgumentException; +use MeowBlog\Application; /** * ApplicationTest class diff --git a/tests/TestCase/Controller/ArticlesControllerTest.php b/tests/TestCase/Controller/ArticlesControllerTest.php index fb8fb3e..30e3bec 100644 --- a/tests/TestCase/Controller/ArticlesControllerTest.php +++ b/tests/TestCase/Controller/ArticlesControllerTest.php @@ -3,7 +3,6 @@ namespace MeowBlog\Test\TestCase\Controller; -use MeowBlog\Controller\ArticlesController; use Cake\TestSuite\IntegrationTestTrait; use Cake\TestSuite\TestCase; diff --git a/tests/TestCase/Controller/TagsControllerTest.php b/tests/TestCase/Controller/TagsControllerTest.php index 2119709..0651934 100644 --- a/tests/TestCase/Controller/TagsControllerTest.php +++ b/tests/TestCase/Controller/TagsControllerTest.php @@ -3,7 +3,6 @@ namespace MeowBlog\Test\TestCase\Controller; -use MeowBlog\Controller\TagsController; use Cake\TestSuite\IntegrationTestTrait; use Cake\TestSuite\TestCase; diff --git a/tests/TestCase/Controller/UsersControllerTest.php b/tests/TestCase/Controller/UsersControllerTest.php index 01a3130..b2fa9b8 100644 --- a/tests/TestCase/Controller/UsersControllerTest.php +++ b/tests/TestCase/Controller/UsersControllerTest.php @@ -3,7 +3,6 @@ namespace MeowBlog\Test\TestCase\Controller; -use MeowBlog\Controller\UsersController; use Cake\TestSuite\IntegrationTestTrait; use Cake\TestSuite\TestCase; diff --git a/tests/TestCase/Model/Table/ArticlesTableTest.php b/tests/TestCase/Model/Table/ArticlesTableTest.php index 27d097a..2e8f67b 100644 --- a/tests/TestCase/Model/Table/ArticlesTableTest.php +++ b/tests/TestCase/Model/Table/ArticlesTableTest.php @@ -3,8 +3,8 @@ namespace MeowBlog\Test\TestCase\Model\Table; -use MeowBlog\Model\Table\ArticlesTable; use Cake\TestSuite\TestCase; +use MeowBlog\Model\Table\ArticlesTable; /** * App\Model\Table\ArticlesTable Test Case diff --git a/tests/TestCase/Model/Table/ArticlesTagsTableTest.php b/tests/TestCase/Model/Table/ArticlesTagsTableTest.php index 57f451b..1088933 100644 --- a/tests/TestCase/Model/Table/ArticlesTagsTableTest.php +++ b/tests/TestCase/Model/Table/ArticlesTagsTableTest.php @@ -3,8 +3,8 @@ namespace MeowBlog\Test\TestCase\Model\Table; -use MeowBlog\Model\Table\ArticlesTagsTable; use Cake\TestSuite\TestCase; +use MeowBlog\Model\Table\ArticlesTagsTable; /** * MeowBlog\Model\Table\ArticlesTagsTable Test Case diff --git a/tests/TestCase/Model/Table/TagsTableTest.php b/tests/TestCase/Model/Table/TagsTableTest.php index 71418f2..f232fea 100644 --- a/tests/TestCase/Model/Table/TagsTableTest.php +++ b/tests/TestCase/Model/Table/TagsTableTest.php @@ -3,8 +3,8 @@ namespace MeowBlog\Test\TestCase\Model\Table; -use MeowBlog\Model\Table\TagsTable; use Cake\TestSuite\TestCase; +use MeowBlog\Model\Table\TagsTable; /** * MeowBlog\Model\Table\TagsTable Test Case diff --git a/tests/TestCase/Model/Table/UsersTableTest.php b/tests/TestCase/Model/Table/UsersTableTest.php index 1dc6599..9af22bf 100644 --- a/tests/TestCase/Model/Table/UsersTableTest.php +++ b/tests/TestCase/Model/Table/UsersTableTest.php @@ -3,8 +3,8 @@ namespace MeowBlog\Test\TestCase\Model\Table; -use MeowBlog\Model\Table\UsersTable; use Cake\TestSuite\TestCase; +use MeowBlog\Model\Table\UsersTable; /** * MeowBlog\Model\Table\UsersTable Test Case From 31c99062e05a65b6eff72402708c2e1ff292b22c Mon Sep 17 00:00:00 2001 From: May Date: Thu, 20 Oct 2022 22:05:20 +0200 Subject: [PATCH 03/13] Update code formating :art: --- src/Application.php | 10 +++++++++- src/Controller/ArticlesController.php | 9 ++++++--- src/Controller/PagesController.php | 3 +++ src/Controller/UsersController.php | 8 ++++++++ src/Model/Entity/Article.php | 5 +++++ src/Model/Entity/User.php | 6 ++++++ src/Model/Table/ArticlesTable.php | 12 ++++++------ src/Policy/ArticlePolicy.php | 15 +++++++++++---- 8 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/Application.php b/src/Application.php index 2688f5c..5d7c32d 100644 --- a/src/Application.php +++ b/src/Application.php @@ -47,7 +47,9 @@ * This defines the bootstrapping logic and middleware layers you * want to use in your application. */ -class Application extends BaseApplication implements AuthenticationServiceProviderInterface, AuthorizationServiceProviderInterface +class Application extends BaseApplication implements + AuthenticationServiceProviderInterface, + AuthorizationServiceProviderInterface { /** * Load all the application configuration and bootstrap logic. @@ -208,6 +210,12 @@ public function getAuthenticationService(ServerRequestInterface $request): Authe return $service; } + /** + * Method getAuthorizationService + * + * @param \Psr\Http\Message\ServerRequestInterface $request Server request + * @return \Authorization\AuthorizationServiceInterface + */ public function getAuthorizationService(ServerRequestInterface $request): AuthorizationServiceInterface { $resolver = new OrmResolver(); diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index 0647d7c..dbe6409 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -15,6 +15,9 @@ class ArticlesController extends AppController { /** * beforeFilter method + * + * @param \Cake\Event\EventInterface $event event + * @return void */ public function beforeFilter(EventInterface $event) { @@ -41,7 +44,7 @@ public function index() /** * View method * - * @param string $slug + * @param string $slug slug * @return \Cake\Http\Response|null|void Renders view * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. */ @@ -105,7 +108,7 @@ public function edit(string $slug) /** * Delete method * - * @param string $slug + * @param string $slug slug * @return \Cake\Http\Response|null|void Redirects to index. * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. */ @@ -124,7 +127,7 @@ public function delete(string $slug) } /** - * @param ...$tags + * @param ...$tags tags * @return void */ public function tags(...$tags) diff --git a/src/Controller/PagesController.php b/src/Controller/PagesController.php index 09f2d1a..b25b088 100644 --- a/src/Controller/PagesController.php +++ b/src/Controller/PagesController.php @@ -34,6 +34,9 @@ class PagesController extends AppController { /** * beforeFilter method + * + * @param \Cake\Event\EventInterface $event event + * @return void */ public function beforeFilter(EventInterface $event) { diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index a2520b5..e59dc0d 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -15,6 +15,9 @@ class UsersController extends AppController { /** * beforeFilter method + * + * @param \Cake\Event\EventInterface $event event + * @return void */ public function beforeFilter(EventInterface $event) { @@ -135,6 +138,11 @@ public function login() } } + /** + * Logout method + * + * @return \Cake\Http\Response|null|void + */ public function logout() { $this->Authorization->skipAuthorization(); diff --git a/src/Model/Entity/Article.php b/src/Model/Entity/Article.php index 10a814a..605c2fd 100644 --- a/src/Model/Entity/Article.php +++ b/src/Model/Entity/Article.php @@ -45,6 +45,11 @@ class Article extends Entity 'tag_string' => true, ]; + /** + * Return tags in string format + * + * @return string + */ protected function _getTagString() { if (isset($this->_fields['tag_string'])) { diff --git a/src/Model/Entity/User.php b/src/Model/Entity/User.php index a4b8d3a..582b5e2 100644 --- a/src/Model/Entity/User.php +++ b/src/Model/Entity/User.php @@ -45,6 +45,12 @@ class User extends Entity 'password', ]; + /** + * Set user password + * + * @param string $password Password + * @return string + */ protected function _setPassword(string $password) { $hasher = new DefaultPasswordHasher(); diff --git a/src/Model/Table/ArticlesTable.php b/src/Model/Table/ArticlesTable.php index b5128e0..8b19b93 100644 --- a/src/Model/Table/ArticlesTable.php +++ b/src/Model/Table/ArticlesTable.php @@ -114,9 +114,9 @@ public function buildRules(RulesChecker $rules): RulesChecker } /** - * @param \Cake\Event\EventInterface $event - * @param $entity - * @param $options + * @param \Cake\Event\EventInterface $event Event + * @param \MeowBlog\Model\Entity\Article $entity Entity + * @param array $options Options * @return void */ public function beforeSave(EventInterface $event, $entity, $options) @@ -133,8 +133,8 @@ public function beforeSave(EventInterface $event, $entity, $options) } /** - * @param \Cake\ORM\Query $query - * @param array $options + * @param \Cake\ORM\Query $query Server Query + * @param array $options Options * @return \Cake\ORM\Query */ public function findTagged(Query $query, array $options): Query @@ -161,7 +161,7 @@ public function findTagged(Query $query, array $options): Query } /** - * @param string $tagString + * @param string $tagString Tag String * @return array<\MeowBlog\Model\Entity\Tag> Array of Tag entities */ protected function _buildTags(string $tagString): array diff --git a/src/Policy/ArticlePolicy.php b/src/Policy/ArticlePolicy.php index cfce39b..e07e805 100644 --- a/src/Policy/ArticlePolicy.php +++ b/src/Policy/ArticlePolicy.php @@ -15,7 +15,7 @@ class ArticlePolicy * Check if $user can add Article * * @param \Authorization\IdentityInterface $user The user. - * @param \MeowBlog\Model\Entity\Article $article + * @param \MeowBlog\Model\Entity\Article $article Article * @return bool */ public function canAdd(IdentityInterface $user, Article $article) @@ -27,7 +27,7 @@ public function canAdd(IdentityInterface $user, Article $article) * Check if $user can edit Article * * @param \Authorization\IdentityInterface $user The user. - * @param \MeowBlog\Model\Entity\Article $article + * @param \MeowBlog\Model\Entity\Article $article Article * @return bool */ public function canEdit(IdentityInterface $user, Article $article) @@ -39,7 +39,7 @@ public function canEdit(IdentityInterface $user, Article $article) * Check if $user can delete Article * * @param \Authorization\IdentityInterface $user The user. - * @param \MeowBlog\Model\Entity\Article $article + * @param \MeowBlog\Model\Entity\Article $article Article * @return bool */ public function canDelete(IdentityInterface $user, Article $article) @@ -51,7 +51,7 @@ public function canDelete(IdentityInterface $user, Article $article) * Check if $user can view Article * * @param \Authorization\IdentityInterface $user The user. - * @param \MeowBlog\Model\Entity\Article $article + * @param \MeowBlog\Model\Entity\Article $article Article * @return bool */ public function canView(IdentityInterface $user, Article $article) @@ -59,6 +59,13 @@ public function canView(IdentityInterface $user, Article $article) return $this->isAuthor($user, $article); } + /** + * Check if $user is Author of article + * + * @param \Authorization\IdentityInterface $user The user. + * @param \MeowBlog\Model\Entity\Article $article Article + * @return bool + */ protected function isAuthor(IdentityInterface $user, Article $article) { return $article->user_id === $user->getIdentifier(); From ad7e81b58350e2aa2589787a06a43d551d5cdbdc Mon Sep 17 00:00:00 2001 From: emma Date: Thu, 20 Oct 2022 22:50:14 +0200 Subject: [PATCH 04/13] Fix STAN errors --- composer.lock | 762 ++++++++++++------------------ src/Model/Table/ArticlesTable.php | 6 +- src/Policy/ArticlePolicy.php | 20 +- 3 files changed, 325 insertions(+), 463 deletions(-) diff --git a/composer.lock b/composer.lock index 4376ff0..4d6e704 100644 --- a/composer.lock +++ b/composer.lock @@ -142,16 +142,16 @@ }, { "name": "cakephp/cakephp", - "version": "4.4.2", + "version": "4.4.6", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "814db4d36f747258fc1790bf6ff2a3ecb936c388" + "reference": "074248ad68fb6669e951862d0f2f82a0d7c99b23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/814db4d36f747258fc1790bf6ff2a3ecb936c388", - "reference": "814db4d36f747258fc1790bf6ff2a3ecb936c388", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/074248ad68fb6669e951862d0f2f82a0d7c99b23", + "reference": "074248ad68fb6669e951862d0f2f82a0d7c99b23", "shasum": "" }, "require": { @@ -242,7 +242,7 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/cakephp" }, - "time": "2022-07-06T02:27:55+00:00" + "time": "2022-10-01T23:52:05+00:00" }, { "name": "cakephp/chronos", @@ -305,22 +305,22 @@ }, { "name": "cakephp/migrations", - "version": "3.5.2", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "e1b03bfef53ce41feabbf2120021ad5187e80289" + "reference": "e1a0a768d6ff572ef5a9aa9024243882f29c96c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/e1b03bfef53ce41feabbf2120021ad5187e80289", - "reference": "e1b03bfef53ce41feabbf2120021ad5187e80289", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/e1a0a768d6ff572ef5a9aa9024243882f29c96c9", + "reference": "e1a0a768d6ff572ef5a9aa9024243882f29c96c9", "shasum": "" }, "require": { "cakephp/cache": "^4.3.0", "cakephp/orm": "^4.3.0", - "php": ">=7.2.0", + "php": ">=7.4.0", "robmorgan/phinx": "^0.12" }, "require-dev": { @@ -361,7 +361,7 @@ "issues": "https://github.com/cakephp/migrations/issues", "source": "https://github.com/cakephp/migrations" }, - "time": "2022-05-10T15:01:58+00:00" + "time": "2022-10-14T05:38:58+00:00" }, { "name": "cakephp/plugin-installer", @@ -414,16 +414,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.2", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640" + "reference": "69098eca243998b53eed7a48d82dedd28b447cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/fd5dd441932a7e10ca6e5b490e272d34c8430640", - "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/69098eca243998b53eed7a48d82dedd28b447cd5", + "reference": "69098eca243998b53eed7a48d82dedd28b447cd5", "shasum": "" }, "require": { @@ -470,7 +470,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.2" + "source": "https://github.com/composer/ca-bundle/tree/1.3.4" }, "funding": [ { @@ -486,29 +486,28 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:56:16+00:00" + "time": "2022-10-12T12:08:29+00:00" }, { "name": "laminas/laminas-diactoros", - "version": "2.13.0", + "version": "2.19.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "34ba65010be9aa74e159d168c5ecfa5c01e4d956" + "reference": "b3c7e9262b4fbec801d8df2370cdebb4f5d3a0ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/34ba65010be9aa74e159d168c5ecfa5c01e4d956", - "reference": "34ba65010be9aa74e159d168c5ecfa5c01e4d956", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/b3c7e9262b4fbec801d8df2370cdebb4f5d3a0ae", + "reference": "b3c7e9262b4fbec801d8df2370cdebb4f5d3a0ae", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, "conflict": { - "phpspec/prophecy": "<1.9.0", "zendframework/zend-diactoros": "*" }, "provide": { @@ -521,12 +520,11 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-coding-standard": "^2.4.0", "php-http/psr7-integration-tests": "^1.1.1", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.5.25", "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" + "vimeo/psalm": "^4.28" }, "type": "library", "extra": { @@ -585,34 +583,34 @@ "type": "community_bridge" } ], - "time": "2022-07-07T12:31:03+00:00" + "time": "2022-10-10T21:28:03+00:00" }, { "name": "laminas/laminas-httphandlerrunner", - "version": "2.1.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-httphandlerrunner.git", - "reference": "4d337cde83e6b901a4443b0ab5c3b97cbaa46413" + "reference": "3c9491473b7decd8f329266a3cb6226a1f90594c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/4d337cde83e6b901a4443b0ab5c3b97cbaa46413", - "reference": "4d337cde83e6b901a4443b0ab5c3b97cbaa46413", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/3c9491473b7decd8f329266a3cb6226a1f90594c", + "reference": "3c9491473b7decd8f329266a3cb6226a1f90594c", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-message": "^1.0", "psr/http-message-implementation": "^1.0", "psr/http-server-handler": "^1.0" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-diactoros": "^2.8.0", - "phpunit/phpunit": "^9.5.9", - "psalm/plugin-phpunit": "^0.16.1", - "vimeo/psalm": "^4.10.0" + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-diactoros": "^2.18", + "phpunit/phpunit": "^9.5.25", + "psalm/plugin-phpunit": "^0.17.0", + "vimeo/psalm": "^4.28" }, "type": "library", "extra": { @@ -652,7 +650,7 @@ "type": "community_bridge" } ], - "time": "2021-09-22T09:27:36+00:00" + "time": "2022-10-10T19:52:02+00:00" }, { "name": "league/container", @@ -1272,16 +1270,16 @@ }, { "name": "robmorgan/phinx", - "version": "0.12.12", + "version": "0.12.13", "source": { "type": "git", "url": "https://github.com/cakephp/phinx.git", - "reference": "9a6ce1e7fdf0fa4e602ba5875b5bc9442ccaa115" + "reference": "6eb0f295e140ed2804d93396755f0ce9ada4ec07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/phinx/zipball/9a6ce1e7fdf0fa4e602ba5875b5bc9442ccaa115", - "reference": "9a6ce1e7fdf0fa4e602ba5875b5bc9442ccaa115", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/6eb0f295e140ed2804d93396755f0ce9ada4ec07", + "reference": "6eb0f295e140ed2804d93396755f0ce9ada4ec07", "shasum": "" }, "require": { @@ -1352,22 +1350,22 @@ ], "support": { "issues": "https://github.com/cakephp/phinx/issues", - "source": "https://github.com/cakephp/phinx/tree/0.12.12" + "source": "https://github.com/cakephp/phinx/tree/0.12.13" }, - "time": "2022-07-09T18:53:51+00:00" + "time": "2022-10-03T04:57:40+00:00" }, { "name": "symfony/config", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "ed8d12417bcacd2d969750feb1fe1aab1c11e613" + "reference": "a0645dc585d378b73c01115dd7ab9348f7d40c85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/ed8d12417bcacd2d969750feb1fe1aab1c11e613", - "reference": "ed8d12417bcacd2d969750feb1fe1aab1c11e613", + "url": "https://api.github.com/repos/symfony/config/zipball/a0645dc585d378b73c01115dd7ab9348f7d40c85", + "reference": "a0645dc585d378b73c01115dd7ab9348f7d40c85", "shasum": "" }, "require": { @@ -1415,7 +1413,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.1.0" + "source": "https://github.com/symfony/config/tree/v6.1.3" }, "funding": [ { @@ -1431,20 +1429,20 @@ "type": "tidelift" } ], - "time": "2022-05-17T12:56:32+00:00" + "time": "2022-07-20T15:00:40+00:00" }, { "name": "symfony/console", - "version": "v6.1.2", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" + "reference": "7fa3b9cf17363468795e539231a5c91b02b608fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "url": "https://api.github.com/repos/symfony/console/zipball/7fa3b9cf17363468795e539231a5c91b02b608fc", + "reference": "7fa3b9cf17363468795e539231a5c91b02b608fc", "shasum": "" }, "require": { @@ -1511,7 +1509,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.2" + "source": "https://github.com/symfony/console/tree/v6.1.6" }, "funding": [ { @@ -1527,7 +1525,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:30+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1598,16 +1596,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.1.0", + "version": "v6.1.5", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d" + "reference": "4d216a2beef096edf040a070117c39ca2abce307" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3132d2f43ca799c2aa099f9738d98228c56baa5d", - "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/4d216a2beef096edf040a070117c39ca2abce307", + "reference": "4d216a2beef096edf040a070117c39ca2abce307", "shasum": "" }, "require": { @@ -1641,7 +1639,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.0" + "source": "https://github.com/symfony/filesystem/tree/v6.1.5" }, "funding": [ { @@ -1657,7 +1655,7 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:34:40+00:00" + "time": "2022-09-21T20:29:40+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2076,16 +2074,16 @@ }, { "name": "symfony/string", - "version": "v6.1.2", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1903f2879875280c5af944625e8246d81c2f0604" + "reference": "7e7e0ff180d4c5a6636eaad57b65092014b61864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", - "reference": "1903f2879875280c5af944625e8246d81c2f0604", + "url": "https://api.github.com/repos/symfony/string/zipball/7e7e0ff180d4c5a6636eaad57b65092014b61864", + "reference": "7e7e0ff180d4c5a6636eaad57b65092014b61864", "shasum": "" }, "require": { @@ -2141,7 +2139,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.2" + "source": "https://github.com/symfony/string/tree/v6.1.6" }, "funding": [ { @@ -2157,7 +2155,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T16:35:04+00:00" + "time": "2022-10-10T09:34:31+00:00" } ], "packages-dev": [ @@ -2212,22 +2210,23 @@ }, { "name": "cakephp/bake", - "version": "2.7.0", + "version": "2.8.2", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "3933caa0941b2f75f3e53c5456efdbf588917584" + "reference": "ef021497ab517c33ecd97d2184200d8990ffc0ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/3933caa0941b2f75f3e53c5456efdbf588917584", - "reference": "3933caa0941b2f75f3e53c5456efdbf588917584", + "url": "https://api.github.com/repos/cakephp/bake/zipball/ef021497ab517c33ecd97d2184200d8990ffc0ab", + "reference": "ef021497ab517c33ecd97d2184200d8990ffc0ab", "shasum": "" }, "require": { "brick/varexporter": "^0.3.5", "cakephp/cakephp": "^4.3.0", "cakephp/twig-view": "^1.0.2", + "nikic/php-parser": "^4.13.2", "php": ">=7.2" }, "require-dev": { @@ -2264,7 +2263,7 @@ "issues": "https://github.com/cakephp/bake/issues", "source": "https://github.com/cakephp/bake" }, - "time": "2022-04-14T08:50:07+00:00" + "time": "2022-10-05T18:45:20+00:00" }, { "name": "cakephp/cakephp-codesniffer", @@ -2320,16 +2319,16 @@ }, { "name": "cakephp/debug_kit", - "version": "4.8.1", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "344fd1afe381e1901bda1a279955c1adf69d6b6d" + "reference": "cd05c7b0d5600308683dc9911c3ff3e4fbe9d590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/344fd1afe381e1901bda1a279955c1adf69d6b6d", - "reference": "344fd1afe381e1901bda1a279955c1adf69d6b6d", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/cd05c7b0d5600308683dc9911c3ff3e4fbe9d590", + "reference": "cd05c7b0d5600308683dc9911c3ff3e4fbe9d590", "shasum": "" }, "require": { @@ -2337,7 +2336,7 @@ "cakephp/chronos": "^2.0", "composer/composer": "^1.3 | ^2.0", "jdorn/sql-formatter": "^1.2", - "php": ">=7.2" + "php": ">=7.4" }, "require-dev": { "cakephp/authorization": "^2.0", @@ -2382,7 +2381,7 @@ "issues": "https://github.com/cakephp/debug_kit/issues", "source": "https://github.com/cakephp/debug_kit" }, - "time": "2022-06-07T19:37:09+00:00" + "time": "2022-07-17T11:47:08+00:00" }, { "name": "cakephp/twig-view", @@ -2447,26 +2446,100 @@ }, "time": "2021-09-17T14:07:52+00:00" }, + { + "name": "composer/class-map-generator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/class-map-generator.git", + "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", + "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "shasum": "" + }, + "require": { + "composer/pcre": "^2 || ^3", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6" + }, + "require-dev": { + "phpstan/phpstan": "^1.6", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/filesystem": "^5.4 || ^6", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\ClassMapGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-06-19T11:31:27+00:00" + }, { "name": "composer/composer", - "version": "2.3.10", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "ebac357c0a41359f3981098729042ed6dedc97ba" + "reference": "b34c0e9a93f2cd688c62ce4dfcc69e13b6ce7aa4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/ebac357c0a41359f3981098729042ed6dedc97ba", - "reference": "ebac357c0a41359f3981098729042ed6dedc97ba", + "url": "https://api.github.com/repos/composer/composer/zipball/b34c0e9a93f2cd688c62ce4dfcc69e13b6ce7aa4", + "reference": "b34c0e9a93f2cd688c62ce4dfcc69e13b6ce7aa4", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", + "composer/class-map-generator": "^1.0", "composer/metadata-minifier": "^1.0", "composer/pcre": "^2 || ^3", "composer/semver": "^3.0", - "composer/spdx-licenses": "^1.2", + "composer/spdx-licenses": "^1.5.7", "composer/xdebug-handler": "^2.0.2 || ^3.0.3", "justinrainbow/json-schema": "^5.2.11", "php": "^7.2.5 || ^8.0", @@ -2474,7 +2547,8 @@ "react/promise": "^2.8", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.2", - "symfony/console": "^5.4.7 || ^6.0.7", + "seld/signal-handler": "^2.0", + "symfony/console": "^5.4.11 || ^6.0.11", "symfony/filesystem": "^5.4 || ^6.0", "symfony/finder": "^5.4 || ^6.0", "symfony/polyfill-php73": "^1.24", @@ -2486,7 +2560,7 @@ "phpstan/phpstan-deprecation-rules": "^1", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1", - "phpstan/phpstan-symfony": "^1.1", + "phpstan/phpstan-symfony": "^1.2.10", "symfony/phpunit-bridge": "^6.0" }, "suggest": { @@ -2500,7 +2574,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.3-dev" + "dev-main": "2.4-dev" }, "phpstan": { "includes": [ @@ -2539,7 +2613,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.3.10" + "source": "https://github.com/composer/composer/tree/2.4.3" }, "funding": [ { @@ -2555,7 +2629,7 @@ "type": "tidelift" } ], - "time": "2022-07-13T13:48:23+00:00" + "time": "2022-10-14T14:56:41+00:00" }, { "name": "composer/metadata-minifier", @@ -3475,16 +3549,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", "shasum": "" }, "require": { @@ -3525,9 +3599,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-09-04T07:30:47+00:00" }, { "name": "phar-io/manifest", @@ -3640,233 +3714,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpstan/phpdoc-parser", "version": "0.4.9", @@ -3986,23 +3833,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -4051,7 +3898,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" }, "funding": [ { @@ -4059,7 +3906,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-08-30T12:24:04+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4304,16 +4151,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", "shasum": "" }, "require": { @@ -4328,7 +4175,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -4336,19 +4182,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -4390,7 +4233,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25" }, "funding": [ { @@ -4400,22 +4243,26 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2022-09-25T03:44:45+00:00" }, { "name": "psy/psysh", - "version": "v0.11.7", + "version": "v0.11.8", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a" + "reference": "f455acf3645262ae389b10e9beba0c358aa6994e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/77fc7270031fbc28f9a7bea31385da5c4855cb7a", - "reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/f455acf3645262ae389b10e9beba0c358aa6994e", + "reference": "f455acf3645262ae389b10e9beba0c358aa6994e", "shasum": "" }, "require": { @@ -4476,9 +4323,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.7" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.8" }, - "time": "2022-07-07T13:49:11+00:00" + "time": "2022-07-28T14:25:11+00:00" }, { "name": "react/promise", @@ -4725,16 +4572,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -4787,7 +4634,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -4795,7 +4642,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -4985,16 +4832,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -5050,7 +4897,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -5058,7 +4905,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -5413,16 +5260,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -5434,7 +5281,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -5457,7 +5304,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -5465,7 +5312,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -5586,16 +5433,16 @@ }, { "name": "seld/phar-utils", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "9f3452c93ff423469c0d56450431562ca423dcee" + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/9f3452c93ff423469c0d56450431562ca423dcee", - "reference": "9f3452c93ff423469c0d56450431562ca423dcee", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", "shasum": "" }, "require": { @@ -5628,9 +5475,70 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.0" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" + }, + "time": "2022-08-31T10:31:18+00:00" + }, + { + "name": "seld/signal-handler", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/signal-handler.git", + "reference": "f69d119511dc0360440cdbdaa71829c149b7be75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/f69d119511dc0360440cdbdaa71829c149b7be75", + "reference": "f69d119511dc0360440cdbdaa71829c149b7be75", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", + "psr/log": "^1 || ^2 || ^3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\Signal\\": "src/" + } }, - "time": "2021-12-10T11:20:11+00:00" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", + "keywords": [ + "posix", + "sigint", + "signal", + "sigterm", + "unix" + ], + "support": { + "issues": "https://github.com/Seldaek/signal-handler/issues", + "source": "https://github.com/Seldaek/signal-handler/tree/2.0.1" + }, + "time": "2022-07-20T18:31:45+00:00" }, { "name": "slevomat/coding-standard", @@ -5751,16 +5659,16 @@ }, { "name": "symfony/finder", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f" + "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/45b8beb69d6eb3b05a65689ebfd4222326773f8f", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f", + "url": "https://api.github.com/repos/symfony/finder/zipball/39696bff2c2970b3779a5cac7bf9f0b88fc2b709", + "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709", "shasum": "" }, "require": { @@ -5795,7 +5703,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.0" + "source": "https://github.com/symfony/finder/tree/v6.1.3" }, "funding": [ { @@ -5811,7 +5719,7 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:08:08+00:00" + "time": "2022-07-29T07:42:06+00:00" }, { "name": "symfony/polyfill-php73", @@ -5977,16 +5885,16 @@ }, { "name": "symfony/process", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", + "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", "shasum": "" }, "require": { @@ -6018,7 +5926,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.0" + "source": "https://github.com/symfony/process/tree/v6.1.3" }, "funding": [ { @@ -6034,20 +5942,20 @@ "type": "tidelift" } ], - "time": "2022-05-11T12:12:29+00:00" + "time": "2022-06-27T17:24:16+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.1.0", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "98587d939cb783aa04e828e8fa857edaca24c212" + "reference": "0f0adde127f24548e23cbde83bcaeadc491c551f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/98587d939cb783aa04e828e8fa857edaca24c212", - "reference": "98587d939cb783aa04e828e8fa857edaca24c212", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0f0adde127f24548e23cbde83bcaeadc491c551f", + "reference": "0f0adde127f24548e23cbde83bcaeadc491c551f", "shasum": "" }, "require": { @@ -6106,7 +6014,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.1.0" + "source": "https://github.com/symfony/var-dumper/tree/v6.1.6" }, "funding": [ { @@ -6122,7 +6030,7 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:34:40+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "theseer/tokenizer", @@ -6249,16 +6157,16 @@ }, { "name": "twig/twig", - "version": "v3.4.1", + "version": "v3.4.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" + "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", - "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58", + "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58", "shasum": "" }, "require": { @@ -6309,7 +6217,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.1" + "source": "https://github.com/twigphp/Twig/tree/v3.4.3" }, "funding": [ { @@ -6321,65 +6229,7 @@ "type": "tidelift" } ], - "time": "2022-05-17T05:48:52+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2022-09-28T08:42:51+00:00" } ], "aliases": [], diff --git a/src/Model/Table/ArticlesTable.php b/src/Model/Table/ArticlesTable.php index 8b19b93..d7aca63 100644 --- a/src/Model/Table/ArticlesTable.php +++ b/src/Model/Table/ArticlesTable.php @@ -9,6 +9,7 @@ use Cake\ORM\Table; use Cake\Utility\Text; use Cake\Validation\Validator; +use MeowBlog\Model\Entity\Article; /** * Articles Model @@ -29,6 +30,7 @@ * @method \MeowBlog\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, $options = []) * @method \MeowBlog\Model\Entity\Article[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, $options = []) * @mixin \Cake\ORM\Behavior\TimestampBehavior + * @method \MeowBlog\Model\Entity\Article|\Cake\ORM\Query findBySlug($slug) */ class ArticlesTable extends Table { @@ -115,11 +117,11 @@ public function buildRules(RulesChecker $rules): RulesChecker /** * @param \Cake\Event\EventInterface $event Event - * @param \MeowBlog\Model\Entity\Article $entity Entity + * @param \MeowBlog\Model\Entity\Article|\Cake\Datasource\EntityInterface $entity Entity * @param array $options Options * @return void */ - public function beforeSave(EventInterface $event, $entity, $options) + public function beforeSave(EventInterface $event, Article $entity, $options) { if ($entity->isNew() && !$entity->slug) { $sluggedTitle = Text::slug($entity->title); diff --git a/src/Policy/ArticlePolicy.php b/src/Policy/ArticlePolicy.php index e07e805..0dcda18 100644 --- a/src/Policy/ArticlePolicy.php +++ b/src/Policy/ArticlePolicy.php @@ -3,6 +3,7 @@ namespace MeowBlog\Policy; +use Authentication\IdentityInterface as AuthenticationInterface; use Authorization\IdentityInterface; use MeowBlog\Model\Entity\Article; @@ -32,7 +33,10 @@ public function canAdd(IdentityInterface $user, Article $article) */ public function canEdit(IdentityInterface $user, Article $article) { - return $this->isAuthor($user, $article); + /** @var \Authentication\IdentityInterface $authenticatedUser */ + $authenticatedUser = $user; + + return $this->isAuthor($authenticatedUser, $article); } /** @@ -44,7 +48,10 @@ public function canEdit(IdentityInterface $user, Article $article) */ public function canDelete(IdentityInterface $user, Article $article) { - return $this->isAuthor($user, $article); + /** @var \Authentication\IdentityInterface $authenticatedUser Authenticated user interface */ + $authenticatedUser = $user; + + return $this->isAuthor($authenticatedUser, $article); } /** @@ -56,17 +63,20 @@ public function canDelete(IdentityInterface $user, Article $article) */ public function canView(IdentityInterface $user, Article $article) { - return $this->isAuthor($user, $article); + /** @var \Authentication\IdentityInterface $authenticatedUser */ + $authenticatedUser = $user; + + return $this->isAuthor($authenticatedUser, $article); } /** * Check if $user is Author of article * - * @param \Authorization\IdentityInterface $user The user. + * @param \Authentication\IdentityInterface $user The user. * @param \MeowBlog\Model\Entity\Article $article Article * @return bool */ - protected function isAuthor(IdentityInterface $user, Article $article) + protected function isAuthor(AuthenticationInterface $user, Article $article) { return $article->user_id === $user->getIdentifier(); } From e5f5970b1ed69264aea8e82cdba5b7372175de5f Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 08:29:03 +0000 Subject: [PATCH 05/13] Fix default namespace in index.php file --- webroot/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webroot/index.php b/webroot/index.php index 6bc06dc..03a1896 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -30,7 +30,7 @@ } require dirname(__DIR__) . '/vendor/autoload.php'; -use App\Application; +use MeowBlog\Application; use Cake\Http\Server; // Bind your application to the server. From 553728542309d11ef342f00e162ca299c707e0ad Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 09:08:42 +0000 Subject: [PATCH 06/13] Fix more errors from stan --- .devcontainer/Dockerfile | 2 ++ .../Tools/src/Controller/AppController.php | 2 +- src/Controller/ArticlesController.php | 22 ++++++++++++++----- src/Model/Entity/Article.php | 1 + src/Model/Table/ArticlesTable.php | 4 +++- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5342e24..362ee91 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -15,5 +15,7 @@ RUN docker-php-ext-install intl pdo_pgsql gd zip pdo_mysql RUN pecl install redis RUN docker-php-ext-enable redis +RUN echo "memory_limit=2G" >> /usr/local/etc/php/conf.d/docker-php-memory-limit.ini + # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 diff --git a/plugins/Tools/src/Controller/AppController.php b/plugins/Tools/src/Controller/AppController.php index 8253f37..3c51fd6 100644 --- a/plugins/Tools/src/Controller/AppController.php +++ b/plugins/Tools/src/Controller/AppController.php @@ -3,7 +3,7 @@ namespace Tools\Controller; -use App\Controller\AppController as BaseController; +use MeowBlog\Controller\AppController as BaseController; class AppController extends BaseController { diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index dbe6409..3080ca1 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -50,7 +50,10 @@ public function index() */ public function view(string $slug) { - $article = $this->Articles->findBySlug($slug)->contain(['Users', 'Tags'])->firstOrfail(); + /** @var \Cake\ORM\Query $q */ + $q = $this->Articles->findBySlug($slug); + + $article = $q->contain(['Users', 'Tags'])->firstOrfail(); $this->Authorization->skipAuthorization(); $this->set(compact('article')); @@ -89,7 +92,11 @@ public function add() */ public function edit(string $slug) { - $article = $this->Articles->findBySlug($slug)->contain(['Tags'])->firstOrFail(); + /** @var \Cake\ORM\Query $q */ + $q = $this->Articles->findBySlug($slug); + + /** @var \Cake\Datasource\EntityInterface $article */ + $article = $q->contain(['Tags'])->firstOrFail(); $this->Authorization->authorize($article); if ($this->request->is(['patch', 'post', 'put'])) { $article = $this->Articles->patchEntity($article, $this->request->getData()); @@ -115,7 +122,12 @@ public function edit(string $slug) public function delete(string $slug) { $this->request->allowMethod(['post', 'delete']); - $article = $this->Articles->findBySlug($slug)->firstOrFail(); + + /** @var \Cake\ORM\Query $q */ + $q = $this->Articles->findBySlug($slug); + + /** @var \Cake\Datasource\EntityInterface $article */ + $article = $q->firstOrFail(); $this->Authorization->authorize($article); if ($this->Articles->delete($article)) { $this->Flash->success(__('The article has been deleted.')); @@ -127,10 +139,10 @@ public function delete(string $slug) } /** - * @param ...$tags tags + * @param string ...$tags tags * @return void */ - public function tags(...$tags) + public function tags(string ...$tags) { $articles = $this->Articles->find('tagged', [ 'tags' => $tags, diff --git a/src/Model/Entity/Article.php b/src/Model/Entity/Article.php index 605c2fd..89eec72 100644 --- a/src/Model/Entity/Article.php +++ b/src/Model/Entity/Article.php @@ -20,6 +20,7 @@ * * @property \MeowBlog\Model\Entity\User $user * @property \MeowBlog\Model\Entity\Tag[] $tags + * @property string $tag_string */ class Article extends Entity { diff --git a/src/Model/Table/ArticlesTable.php b/src/Model/Table/ArticlesTable.php index d7aca63..dc9f3de 100644 --- a/src/Model/Table/ArticlesTable.php +++ b/src/Model/Table/ArticlesTable.php @@ -3,6 +3,7 @@ namespace MeowBlog\Model\Table; +use Cake\Datasource\EntityInterface; use Cake\Event\EventInterface; use Cake\ORM\Query; use Cake\ORM\RulesChecker; @@ -121,8 +122,9 @@ public function buildRules(RulesChecker $rules): RulesChecker * @param array $options Options * @return void */ - public function beforeSave(EventInterface $event, Article $entity, $options) + public function beforeSave(EventInterface $event, EntityInterface $entity, $options) { + /** @var \MeowBlog\Model\Entity\Article $entity */ if ($entity->isNew() && !$entity->slug) { $sluggedTitle = Text::slug($entity->title); // trim slug to maximum length defined in schema From be10af8fbd72b4d0a2e46a5226c88fff0506bfcb Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 09:10:00 +0000 Subject: [PATCH 07/13] Remove cs error --- src/Model/Table/ArticlesTable.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Model/Table/ArticlesTable.php b/src/Model/Table/ArticlesTable.php index dc9f3de..068b921 100644 --- a/src/Model/Table/ArticlesTable.php +++ b/src/Model/Table/ArticlesTable.php @@ -10,7 +10,6 @@ use Cake\ORM\Table; use Cake\Utility\Text; use Cake\Validation\Validator; -use MeowBlog\Model\Entity\Article; /** * Articles Model From 1bc663e5d9cad67d1d88ab3992a53c097b93bb57 Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 09:22:23 +0000 Subject: [PATCH 08/13] update workflow --- .github/workflows/ci.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69295dd..0a24016 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,21 +16,7 @@ jobs: image: postgres:12.4 steps: - uses: actions/checkout@v2 - - name: Migrate - uses: MayMeowHQ/composer-run-action@v7 - with: - composer_script: 'migrate' - env: - REDIS_HOST: 'redis' - REDIS_PORT: '6379' - DB_HOST: postgres - DB_PASSWORD: cakepass - DB_NAME: cake - DB_USER: cake - POSTGRES_PASSWORD: cakepass - POSTGRES_USER: cake - POSTGRES_DB: cake - - name: Composer run action PHPC_CS + - name: Composer run action TEST uses: MayMeowHQ/composer-run-action@v7 with: composer_script: 'test' From 9e21d5b6f4121987e02700962b23455c2ae74bd3 Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 09:28:43 +0000 Subject: [PATCH 09/13] update workflow --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a24016..e15abf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,10 @@ jobs: env: REDIS_HOST: 'redis' REDIS_PORT: '6379' - DB_HOST: postgres - DB_PASSWORD: cakepass - DB_NAME: cake - DB_USER: cake + DB_TEST_HOST: postgres + DB_TEST_PASSWORD: cakepass + DB_TEST_NAME: cake + DB_TEST_USER: cake POSTGRES_PASSWORD: cakepass POSTGRES_USER: cake POSTGRES_DB: cake From e1df1f3f13daf6a0ade170ad40a2b4e700f47bd2 Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 09:37:30 +0000 Subject: [PATCH 10/13] move tests to sqlite --- tests/bootstrap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 962815c..14d2e66 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -17,6 +17,7 @@ use Cake\Core\Configure; use Cake\Datasource\ConnectionManager; +use Migrations\TestSuite\Migrator; /** * Test runner bootstrap. @@ -44,6 +45,10 @@ 'quoteIdentifiers' => false, ]); +// run migrations +$migrator = new Migrator(); +$migrator->run(); + ConnectionManager::alias('test_debug_kit', 'debug_kit'); // Fixate sessionid early on, as php7.2+ From 12a567314406e9de824255c18b83b3a589cada96 Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 09:40:18 +0000 Subject: [PATCH 11/13] fix --- config/app_local.example.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config/app_local.example.php b/config/app_local.example.php index de7baca..8ecf83d 100644 --- a/config/app_local.example.php +++ b/config/app_local.example.php @@ -66,11 +66,12 @@ * The test connection is used during the test suite. */ 'test' => [ - 'host' => 'localhost', - //'port' => 'non_standard_port_number', - 'username' => 'my_app', - 'password' => 'secret', - 'database' => 'test_myapp', + 'driver' => \Cake\Database\Driver\Sqlite::class, + // 'host' => env('DB_TEST_HOST', null), + // 'port' => 'non_standard_port_number', + // 'username' => env('DB_TEST_USER', null), + // 'password' => env('DB_TEST_PASSWORD', null), + 'database' => "/tmp/test.db", //'schema' => 'myapp', 'url' => env('DATABASE_TEST_URL', null), ], From 082ef138c282c8751d31b1dda10dad14588f9203 Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 11:05:58 +0000 Subject: [PATCH 12/13] Fix test error tag_id is supposed to be integer not string --- src/Model/Table/ArticlesTagsTable.php | 2 +- tests/Fixture/ArticlesTagsFixture.php | 2 +- tests/TestCase/ApplicationTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/Table/ArticlesTagsTable.php b/src/Model/Table/ArticlesTagsTable.php index 4abdb55..c408727 100644 --- a/src/Model/Table/ArticlesTagsTable.php +++ b/src/Model/Table/ArticlesTagsTable.php @@ -66,7 +66,7 @@ public function validationDefault(Validator $validator): Validator ->notEmptyString('article_id'); $validator - ->scalar('tag_id') + ->integer('tag_id') ->requirePresence('tag_id', 'create') ->notEmptyString('tag_id'); diff --git a/tests/Fixture/ArticlesTagsFixture.php b/tests/Fixture/ArticlesTagsFixture.php index e309351..397422f 100644 --- a/tests/Fixture/ArticlesTagsFixture.php +++ b/tests/Fixture/ArticlesTagsFixture.php @@ -21,7 +21,7 @@ public function init(): void [ 'id' => 1, 'article_id' => 1, - 'tag_id' => 'Lorem ipsum dolor sit amet', + 'tag_id' => 1, ], ]; parent::init(); diff --git a/tests/TestCase/ApplicationTest.php b/tests/TestCase/ApplicationTest.php index 43346f3..d77903a 100644 --- a/tests/TestCase/ApplicationTest.php +++ b/tests/TestCase/ApplicationTest.php @@ -40,7 +40,7 @@ public function testBootstrap() $app->bootstrap(); $plugins = $app->getPlugins(); - $this->assertCount(4, $plugins); + $this->assertCount(6, $plugins); $this->assertSame('Bake', $plugins->get('Bake')->getName()); $this->assertSame('DebugKit', $plugins->get('DebugKit')->getName()); $this->assertSame('Migrations', $plugins->get('Migrations')->getName()); From dc24f04eeccd42c8d5340b697b352520913d8a1d Mon Sep 17 00:00:00 2001 From: May Date: Mon, 24 Oct 2022 11:17:38 +0000 Subject: [PATCH 13/13] add coverage report --- .gitignore | 2 ++ composer.json | 1 + 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 3a2c66f..a436912 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ nbproject/* .vscode # Sass preprocessor .sass-cache/ +# Coverage report +clover.xml \ No newline at end of file diff --git a/composer.json b/composer.json index ccfa03b..3ed891a 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "cs-fix": "phpcbf --colors -p src/ tests/", "stan": "phpstan analyse", "test": "phpunit --colors=always", + "coverage": "XDEBUG_MODE=coverage phpunit --coverage-clover clover.xml", "migrate": "php bin/cake.php migrations migrate" }, "prefer-stable": true,