From 177fd31d552ef48a7ef85fc43dc2f9d73e77151d Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 13 Sep 2022 09:15:15 -0400 Subject: [PATCH 1/5] [make:crud] remove unneeded parentheses --- src/Resources/skeleton/crud/test/Test.EntityManager.tpl.php | 2 +- src/Resources/skeleton/crud/test/Test.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/skeleton/crud/test/Test.EntityManager.tpl.php b/src/Resources/skeleton/crud/test/Test.EntityManager.tpl.php index 5d6ed55d3..99bb52b0e 100644 --- a/src/Resources/skeleton/crud/test/Test.EntityManager.tpl.php +++ b/src/Resources/skeleton/crud/test/Test.EntityManager.tpl.php @@ -15,7 +15,7 @@ class extends WebTestCase protected function setUp(): void { $this->client = static::createClient(); - $this->manager = (static::getContainer()->get('doctrine'))->getManager(); + $this->manager = static::getContainer()->get('doctrine')->getManager(); $this->repository = $this->manager->getRepository(::class); foreach ($this->repository->findAll() as $object) { diff --git a/src/Resources/skeleton/crud/test/Test.tpl.php b/src/Resources/skeleton/crud/test/Test.tpl.php index 7b7a6e8c9..200de4665 100644 --- a/src/Resources/skeleton/crud/test/Test.tpl.php +++ b/src/Resources/skeleton/crud/test/Test.tpl.php @@ -14,7 +14,7 @@ class extends WebTestCase protected function setUp(): void { $this->client = static::createClient(); - $this->repository = (static::getContainer()->get('doctrine'))->getRepository(::class); + $this->repository = static::getContainer()->get('doctrine')->getRepository(::class); foreach ($this->repository->findAll() as $object) { $this->repository->remove($object, true); From 22a3915fe11b20e899fd18c725018011d5a03f13 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 13 Sep 2022 09:36:33 -0400 Subject: [PATCH 2/5] [make:validator] add line break between annotation and target --- src/Resources/skeleton/validator/Constraint.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Resources/skeleton/validator/Constraint.tpl.php b/src/Resources/skeleton/validator/Constraint.tpl.php index e713088a8..991ad9424 100644 --- a/src/Resources/skeleton/validator/Constraint.tpl.php +++ b/src/Resources/skeleton/validator/Constraint.tpl.php @@ -6,6 +6,7 @@ /** * @Annotation + * * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] From d3e537cd55cc6c194c8ed6f1f63d7a0fbe445b02 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 13 Sep 2022 10:06:02 -0400 Subject: [PATCH 3/5] [make:entity] use a 256bit secret for jwt in mercure test --- tests/Maker/MakeEntityTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Maker/MakeEntityTest.php b/tests/Maker/MakeEntityTest.php index 6bd7ad943..ff549791e 100644 --- a/tests/Maker/MakeEntityTest.php +++ b/tests/Maker/MakeEntityTest.php @@ -559,6 +559,13 @@ public function getTestDetails(): \Generator 'http://127.0.0.1:1337/.well-known/mercure' ); + // JWT Secrets needs to be at least 256 bits in length + $runner->replaceInFile( + '.env', + 'MERCURE_JWT_SECRET="!ChangeMe!"', + 'MERCURE_JWT_SECRET="!ChangeMe!!ChangeMe!!ChangeMe!!ChangeMe!"' + ); + $runner->runMaker([ // entity class name 'User', From cb5b0009c93fb894268c955c1cf86258a3ed82fc Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 13 Sep 2022 10:15:40 -0400 Subject: [PATCH 4/5] [csm] fix empty class source file --- tests/Util/fixtures/source/User_empty.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Util/fixtures/source/User_empty.php b/tests/Util/fixtures/source/User_empty.php index fe362adb5..0bd2d7a75 100644 --- a/tests/Util/fixtures/source/User_empty.php +++ b/tests/Util/fixtures/source/User_empty.php @@ -2,4 +2,6 @@ namespace App\Entity; -class User {} +class User +{ +} From 651ae53b66c4fde1ee0db5db9e28afbfb1af94b5 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 13 Sep 2022 10:26:18 -0400 Subject: [PATCH 5/5] [make:entity] set 256bit jwt secret in CI for test --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1a6b24ba5..029544185 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,8 +74,8 @@ jobs: image: dunglas/mercure env: SERVER_NAME: :1337 - MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!' - MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!' + MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!!ChangeMe!!ChangeMe!!ChangeMe!' + MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!!ChangeMe!!ChangeMe!!ChangeMe!' MERCURE_EXTRA_DIRECTIVES: | anonymous cors_origins *