From 377675e4e46eb208e10256f1879e84f255b53896 Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Thu, 14 Sep 2023 14:40:35 +0200 Subject: [PATCH] fix phpcs warnings --- composer.json | 5 +++++ .../src/FactoryType/ParagraphFactoryType.php | 2 +- .../src/FactoryType/ParagraphTypeFactoryType.php | 2 +- .../tests/src/Kernel/ParagraphFactoryTest.php | 2 +- .../src/Kernel/ParagraphFieldEntityReferenceFactoryTest.php | 4 ++-- .../tests/src/Kernel/ParagraphFieldFactoryTest.php | 2 +- src/FactoryType/EntityFieldEntityReferenceFactoryType.php | 6 +++--- src/FactoryType/EntityFieldFactoryType.php | 4 ++-- src/FactoryType/FileFactoryType.php | 4 ++-- src/FactoryType/MediaFactoryType.php | 2 +- src/FactoryType/MenuLinkFactoryType.php | 2 +- src/FactoryType/NodeFactoryType.php | 4 ++-- src/FactoryType/NodeTypeFactoryType.php | 2 +- src/FactoryType/TaxonomyTermFactoryType.php | 2 +- src/FactoryType/UserFactoryType.php | 2 +- src/FactoryType/VocabularyFactoryType.php | 2 +- .../tests/src/Kernel/MediaFieldFactoryTest.php | 2 +- .../tests/src/Kernel/MenuFactoryTest.php | 2 +- .../tests/src/Kernel/MenuLinkFactoryTest.php | 2 +- .../tests/src/Kernel/MenuLinksFactoryTest.php | 2 +- tests/src/Unit/ChainFactoryResolverTest.php | 2 +- tests/src/Unit/ChainFactoryTypeResolverTest.php | 2 +- tests/src/Unit/FixtureFactoryTest.php | 2 +- 23 files changed, 33 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index c645424..5904bff 100644 --- a/composer.json +++ b/composer.json @@ -23,5 +23,10 @@ "license": "GPL-2.0-or-later", "require-dev": { "drupal/coder": "^8.3.1" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphFactoryType.php b/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphFactoryType.php index f71424a..638388f 100644 --- a/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphFactoryType.php +++ b/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphFactoryType.php @@ -2,8 +2,8 @@ namespace Drupal\factory_lollipop_paragraphs\FactoryType; -use Drupal\factory_lollipop\FactoryType\FactoryTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\factory_lollipop\FactoryType\FactoryTypeInterface; use Drupal\paragraphs\Entity\Paragraph; /** diff --git a/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphTypeFactoryType.php b/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphTypeFactoryType.php index 1ca7819..f7115c4 100644 --- a/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphTypeFactoryType.php +++ b/modules/factory_lollipop_paragraphs/src/FactoryType/ParagraphTypeFactoryType.php @@ -2,8 +2,8 @@ namespace Drupal\factory_lollipop_paragraphs\FactoryType; -use Drupal\factory_lollipop\FactoryType\FactoryTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\factory_lollipop\FactoryType\FactoryTypeInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; use Drupal\paragraphs\Entity\ParagraphsType; diff --git a/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFactoryTest.php b/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFactoryTest.php index eeaa4af..eab3b5f 100644 --- a/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFactoryTest.php +++ b/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFactoryTest.php @@ -2,8 +2,8 @@ namespace Drupal\Tests\factory_lollipop_paragraphs_test\Kernel; -use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; use Drupal\paragraphs\Entity\Paragraph; +use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** * Example of Factory Lollipop usage for Paragraph. diff --git a/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldEntityReferenceFactoryTest.php b/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldEntityReferenceFactoryTest.php index 59c8632..7e23bd0 100644 --- a/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldEntityReferenceFactoryTest.php +++ b/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldEntityReferenceFactoryTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\factory_lollipop_paragraphs_test\Kernel; -use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; -use Drupal\paragraphs\Entity\Paragraph; use Drupal\entity_test\Entity\EntityTest; +use Drupal\paragraphs\Entity\Paragraph; +use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** * Example of Factory Lollipop usage for Paragraph with entity reference fields. diff --git a/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldFactoryTest.php b/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldFactoryTest.php index 8e80d6a..989c523 100644 --- a/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldFactoryTest.php +++ b/modules/factory_lollipop_paragraphs/tests/modules/factory_lollipop_paragraphs_test/tests/src/Kernel/ParagraphFieldFactoryTest.php @@ -2,8 +2,8 @@ namespace Drupal\Tests\factory_lollipop_paragraphs_test\Kernel; -use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; use Drupal\paragraphs\Entity\Paragraph; +use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** * Example of Factory Lollipop usage for Paragraph with fields. diff --git a/src/FactoryType/EntityFieldEntityReferenceFactoryType.php b/src/FactoryType/EntityFieldEntityReferenceFactoryType.php index 4f7f035..2ccab3b 100644 --- a/src/FactoryType/EntityFieldEntityReferenceFactoryType.php +++ b/src/FactoryType/EntityFieldEntityReferenceFactoryType.php @@ -2,11 +2,11 @@ namespace Drupal\factory_lollipop\FactoryType; -use Drupal\field\Entity\FieldConfig; -use Drupal\field\FieldConfigInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\factory_lollipop\Traits\EntityReferenceTestTrait; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; -use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\field\Entity\FieldConfig; +use Drupal\field\FieldConfigInterface; /** * Creates Drupal Entity Reference Fields for use in tests. diff --git a/src/FactoryType/EntityFieldFactoryType.php b/src/FactoryType/EntityFieldFactoryType.php index b0b8a30..676f60c 100644 --- a/src/FactoryType/EntityFieldFactoryType.php +++ b/src/FactoryType/EntityFieldFactoryType.php @@ -2,9 +2,9 @@ namespace Drupal\factory_lollipop\FactoryType; -use Drupal\field\FieldConfigInterface; -use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\field\FieldConfigInterface; /** * Creates Drupal Entity Fields for use in tests. diff --git a/src/FactoryType/FileFactoryType.php b/src/FactoryType/FileFactoryType.php index a1487d1..6ffc3b1 100644 --- a/src/FactoryType/FileFactoryType.php +++ b/src/FactoryType/FileFactoryType.php @@ -2,11 +2,11 @@ namespace Drupal\factory_lollipop\FactoryType; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\File\FileSystemInterface; -use Drupal\file\FileInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\file\FileInterface; /** * Creates Drupal Files for use in tests. diff --git a/src/FactoryType/MediaFactoryType.php b/src/FactoryType/MediaFactoryType.php index fcb5121..e6a68b9 100644 --- a/src/FactoryType/MediaFactoryType.php +++ b/src/FactoryType/MediaFactoryType.php @@ -4,8 +4,8 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageInterface; -use Drupal\media\MediaInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\media\MediaInterface; /** * Creates Drupal Medias for use in tests. diff --git a/src/FactoryType/MenuLinkFactoryType.php b/src/FactoryType/MenuLinkFactoryType.php index 46e7789..19cb0a5 100644 --- a/src/FactoryType/MenuLinkFactoryType.php +++ b/src/FactoryType/MenuLinkFactoryType.php @@ -3,8 +3,8 @@ namespace Drupal\factory_lollipop\FactoryType; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\menu_link_content\MenuLinkContentInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\menu_link_content\MenuLinkContentInterface; /** * Creates Drupal Menu Link for use in tests. diff --git a/src/FactoryType/NodeFactoryType.php b/src/FactoryType/NodeFactoryType.php index 51b1436..a35e451 100644 --- a/src/FactoryType/NodeFactoryType.php +++ b/src/FactoryType/NodeFactoryType.php @@ -2,10 +2,10 @@ namespace Drupal\factory_lollipop\FactoryType; -use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\node\NodeInterface; +use Drupal\Core\Language\LanguageInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\node\NodeInterface; /** * Creates Drupal Nodes for use in tests. diff --git a/src/FactoryType/NodeTypeFactoryType.php b/src/FactoryType/NodeTypeFactoryType.php index 273f17e..b2bd03b 100644 --- a/src/FactoryType/NodeTypeFactoryType.php +++ b/src/FactoryType/NodeTypeFactoryType.php @@ -3,8 +3,8 @@ namespace Drupal\factory_lollipop\FactoryType; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\node\NodeTypeInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\node\NodeTypeInterface; /** * Creates Drupal Node Type for use in tests. diff --git a/src/FactoryType/TaxonomyTermFactoryType.php b/src/FactoryType/TaxonomyTermFactoryType.php index e733634..c6f0876 100644 --- a/src/FactoryType/TaxonomyTermFactoryType.php +++ b/src/FactoryType/TaxonomyTermFactoryType.php @@ -4,8 +4,8 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageInterface; -use Drupal\taxonomy\TermInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\taxonomy\TermInterface; /** * Creates Drupal Taxonomy Term for use in tests. diff --git a/src/FactoryType/UserFactoryType.php b/src/FactoryType/UserFactoryType.php index dd21429..12003e4 100644 --- a/src/FactoryType/UserFactoryType.php +++ b/src/FactoryType/UserFactoryType.php @@ -3,10 +3,10 @@ namespace Drupal\factory_lollipop\FactoryType; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Password\PasswordGeneratorInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; use Drupal\factory_lollipop\Traits\UserCreationTrait; use Drupal\user\UserInterface; -use Drupal\Core\Password\PasswordGeneratorInterface; /** * Creates Drupal Users for use in tests. diff --git a/src/FactoryType/VocabularyFactoryType.php b/src/FactoryType/VocabularyFactoryType.php index bcebefa..fb5f833 100644 --- a/src/FactoryType/VocabularyFactoryType.php +++ b/src/FactoryType/VocabularyFactoryType.php @@ -3,8 +3,8 @@ namespace Drupal\factory_lollipop\FactoryType; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\taxonomy\VocabularyInterface; use Drupal\factory_lollipop\Traits\RandomGeneratorTrait; +use Drupal\taxonomy\VocabularyInterface; /** * Creates Drupal Vocabulary for use in tests. diff --git a/tests/modules/factory_lollipop_test/tests/src/Kernel/MediaFieldFactoryTest.php b/tests/modules/factory_lollipop_test/tests/src/Kernel/MediaFieldFactoryTest.php index 23678d2..b62b422 100644 --- a/tests/modules/factory_lollipop_test/tests/src/Kernel/MediaFieldFactoryTest.php +++ b/tests/modules/factory_lollipop_test/tests/src/Kernel/MediaFieldFactoryTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\factory_lollipop_test\Kernel; +use Drupal\file\Entity\File as EntityFile; use Drupal\media\MediaInterface; use Drupal\media\Plugin\media\Source\File; -use Drupal\file\Entity\File as EntityFile; use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** diff --git a/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuFactoryTest.php b/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuFactoryTest.php index 23edd03..9577743 100644 --- a/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuFactoryTest.php +++ b/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuFactoryTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\factory_lollipop_test\Kernel; -use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; use Drupal\system\Entity\Menu; use Drupal\system\MenuInterface; +use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** * Example of Factory Lollipop usage for Menu. diff --git a/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinkFactoryTest.php b/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinkFactoryTest.php index e79a756..15e010e 100644 --- a/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinkFactoryTest.php +++ b/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinkFactoryTest.php @@ -5,8 +5,8 @@ use Drupal\Core\Url; use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\menu_link_content\MenuLinkContentInterface; -use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; use Drupal\system\Entity\Menu; +use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** * Example of Factory Lollipop usage for Menu Link. diff --git a/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinksFactoryTest.php b/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinksFactoryTest.php index 2883536..eac3f78 100644 --- a/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinksFactoryTest.php +++ b/tests/modules/factory_lollipop_test/tests/src/Kernel/MenuLinksFactoryTest.php @@ -3,8 +3,8 @@ namespace Drupal\Tests\factory_lollipop_test\Kernel; use Drupal\menu_link_content\MenuLinkContentInterface; -use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; use Drupal\system\Entity\Menu; +use Drupal\Tests\factory_lollipop\Kernel\LollipopKernelTestBase; /** * Example of Factory Lollipop usage for Menu Link Hierarchy. diff --git a/tests/src/Unit/ChainFactoryResolverTest.php b/tests/src/Unit/ChainFactoryResolverTest.php index dde3397..0132047 100644 --- a/tests/src/Unit/ChainFactoryResolverTest.php +++ b/tests/src/Unit/ChainFactoryResolverTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\factory_lollipop\Unit\Resolver; +use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\factory_lollipop\FactoryInterface; use Drupal\factory_lollipop\Resolver\ChainFactoryResolver; -use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Tests\UnitTestCase; /** diff --git a/tests/src/Unit/ChainFactoryTypeResolverTest.php b/tests/src/Unit/ChainFactoryTypeResolverTest.php index c1cdc5d..483557c 100644 --- a/tests/src/Unit/ChainFactoryTypeResolverTest.php +++ b/tests/src/Unit/ChainFactoryTypeResolverTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\factory_lollipop\Unit\Resolver; +use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\factory_lollipop\FactoryType\FactoryTypeInterface; use Drupal\factory_lollipop\Resolver\ChainFactoryTypeResolver; -use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Tests\UnitTestCase; /** diff --git a/tests/src/Unit/FixtureFactoryTest.php b/tests/src/Unit/FixtureFactoryTest.php index ec57ac4..603e92b 100644 --- a/tests/src/Unit/FixtureFactoryTest.php +++ b/tests/src/Unit/FixtureFactoryTest.php @@ -4,8 +4,8 @@ use Drupal\factory_lollipop\FactoryType\FactoryTypeInterface; use Drupal\factory_lollipop\FixtureFactory; -use Drupal\factory_lollipop\Resolver\ChainFactoryTypeResolver; use Drupal\factory_lollipop\Resolver\ChainFactoryResolver; +use Drupal\factory_lollipop\Resolver\ChainFactoryTypeResolver; use Drupal\Tests\UnitTestCase; /**