From 3e4f993ecc98491b65e67e61965c9883986adf22 Mon Sep 17 00:00:00 2001 From: Christian Frantzen Date: Wed, 21 Aug 2024 15:49:44 +0200 Subject: [PATCH 1/6] refactor: removing deprecations from migrations --- .../phpcr-migrations/Version201702211450.php | 18 +++++++++++++++--- .../phpcr-migrations/Version201712041018.php | 18 +++++++++++++++--- .../phpcr-migrations/Version201811091000.php | 18 +++++++++++++++--- .../phpcr-migrations/Version201905071542.php | 18 +++++++++++++++--- .../phpcr-migrations/Version202005151141.php | 19 ++++++++++++++++--- .../phpcr-migrations/Version202005191117.php | 19 ++++++++++++++++--- .../phpcr-migrations/Version202005250920.php | 19 ++++++++++++++++--- .../phpcr-migrations/Version202210140922.php | 19 ++++++++++++++++--- .../phpcr-migrations/Version202210241106.php | 19 ++++++++++++++++--- 9 files changed, 140 insertions(+), 27 deletions(-) diff --git a/Resources/phpcr-migrations/Version201702211450.php b/Resources/phpcr-migrations/Version201702211450.php index f4c5f82c..57a37283 100644 --- a/Resources/phpcr-migrations/Version201702211450.php +++ b/Resources/phpcr-migrations/Version201702211450.php @@ -14,17 +14,29 @@ use Jackalope\Node; use Jackalope\Query\Row; use PHPCR\Migrations\VersionInterface; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; use PHPCR\SessionInterface; use Sulu\Component\Localization\Localization; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Removes the property `i18n:-authors` and adds `i18n:-author`. */ class Version201702211450 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } public function up(SessionInterface $session) { diff --git a/Resources/phpcr-migrations/Version201712041018.php b/Resources/phpcr-migrations/Version201712041018.php index 5bf639bb..d03115c9 100644 --- a/Resources/phpcr-migrations/Version201712041018.php +++ b/Resources/phpcr-migrations/Version201712041018.php @@ -17,15 +17,27 @@ use PHPCR\NodeInterface; use PHPCR\SessionInterface; use Sulu\Component\Localization\Localization; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Removes the property `sulu:author(ed)` and adds `i18n:-author(ed)`. */ class Version201712041018 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } public const AUTHOR_PROPERTY_NAME = 'sulu:author'; diff --git a/Resources/phpcr-migrations/Version201811091000.php b/Resources/phpcr-migrations/Version201811091000.php index c7942618..618b73cb 100644 --- a/Resources/phpcr-migrations/Version201811091000.php +++ b/Resources/phpcr-migrations/Version201811091000.php @@ -17,8 +17,8 @@ use PHPCR\NodeInterface; use PHPCR\SessionInterface; use Sulu\Component\Localization\Localization; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; + +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Removes the property `mainWebspace` and adds `i18n:-mainWebspace`. @@ -26,7 +26,19 @@ */ class Version201811091000 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } public const MAIN_WEBSPACE_PROPERTY_NAME = 'mainWebspace'; diff --git a/Resources/phpcr-migrations/Version201905071542.php b/Resources/phpcr-migrations/Version201905071542.php index 9040450b..d6979b34 100644 --- a/Resources/phpcr-migrations/Version201905071542.php +++ b/Resources/phpcr-migrations/Version201905071542.php @@ -13,12 +13,24 @@ use PHPCR\Migrations\VersionInterface; use PHPCR\SessionInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; class Version201905071542 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } public function up(SessionInterface $session) { diff --git a/Resources/phpcr-migrations/Version202005151141.php b/Resources/phpcr-migrations/Version202005151141.php index f649ba2d..275d70db 100644 --- a/Resources/phpcr-migrations/Version202005151141.php +++ b/Resources/phpcr-migrations/Version202005151141.php @@ -13,12 +13,25 @@ use PHPCR\Migrations\VersionInterface; use PHPCR\SessionInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; class Version202005151141 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } + public function up(SessionInterface $session) { diff --git a/Resources/phpcr-migrations/Version202005191117.php b/Resources/phpcr-migrations/Version202005191117.php index 40880d39..395c4809 100644 --- a/Resources/phpcr-migrations/Version202005191117.php +++ b/Resources/phpcr-migrations/Version202005191117.php @@ -13,12 +13,25 @@ use PHPCR\Migrations\VersionInterface; use PHPCR\SessionInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; class Version202005191117 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } + public function up(SessionInterface $session) { diff --git a/Resources/phpcr-migrations/Version202005250920.php b/Resources/phpcr-migrations/Version202005250920.php index b50a8092..57f7911a 100644 --- a/Resources/phpcr-migrations/Version202005250920.php +++ b/Resources/phpcr-migrations/Version202005250920.php @@ -13,12 +13,25 @@ use PHPCR\Migrations\VersionInterface; use PHPCR\SessionInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; class Version202005250920 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } + public function up(SessionInterface $session) { diff --git a/Resources/phpcr-migrations/Version202210140922.php b/Resources/phpcr-migrations/Version202210140922.php index 0c61c814..de7e8e9d 100644 --- a/Resources/phpcr-migrations/Version202210140922.php +++ b/Resources/phpcr-migrations/Version202210140922.php @@ -13,15 +13,28 @@ use PHPCR\Migrations\VersionInterface; use PHPCR\SessionInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * Auto-generated Migration: Please modify to your needs! */ final class Version202210140922 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } + public function up(SessionInterface $session) { diff --git a/Resources/phpcr-migrations/Version202210241106.php b/Resources/phpcr-migrations/Version202210241106.php index 0f7403b9..96ccbddb 100644 --- a/Resources/phpcr-migrations/Version202210241106.php +++ b/Resources/phpcr-migrations/Version202210241106.php @@ -15,12 +15,25 @@ use PHPCR\Migrations\VersionInterface; use PHPCR\SessionInterface; use Sulu\Component\Localization\Localization; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; class Version202210241106 implements VersionInterface, ContainerAwareInterface { - use ContainerAwareTrait; + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(?ContainerInterface $container = null): void + { + if (null === $container) { + throw new \RuntimeException('Container is required to run this migration.'); + } + + $this->container = $container; + } + public function up(SessionInterface $session) { From 2c9fb3749c30feee236f98dc871324c2bd6da7d8 Mon Sep 17 00:00:00 2001 From: Christian Frantzen Date: Wed, 21 Aug 2024 15:59:39 +0200 Subject: [PATCH 2/6] fix: add missing use statement --- Resources/phpcr-migrations/Version201811091000.php | 1 + Resources/phpcr-migrations/Version202210140922.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Resources/phpcr-migrations/Version201811091000.php b/Resources/phpcr-migrations/Version201811091000.php index 618b73cb..de33ace9 100644 --- a/Resources/phpcr-migrations/Version201811091000.php +++ b/Resources/phpcr-migrations/Version201811091000.php @@ -15,6 +15,7 @@ use Jackalope\Query\Row; use PHPCR\Migrations\VersionInterface; use PHPCR\NodeInterface; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; use PHPCR\SessionInterface; use Sulu\Component\Localization\Localization; diff --git a/Resources/phpcr-migrations/Version202210140922.php b/Resources/phpcr-migrations/Version202210140922.php index de7e8e9d..153c4645 100644 --- a/Resources/phpcr-migrations/Version202210140922.php +++ b/Resources/phpcr-migrations/Version202210140922.php @@ -12,6 +12,7 @@ namespace Sulu\Bundle\ArticleBundle; use PHPCR\Migrations\VersionInterface; +use PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface; use PHPCR\SessionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; From caf31da5102c0e005a0c045221932566ce9d2bca Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 27 Aug 2024 09:42:41 +0200 Subject: [PATCH 3/6] Use own ContainerAwareInterface --- .../ContainerAwareInterface.php | 29 +++++++++++++++++++ .../phpcr-migrations/Version201702211450.php | 1 - .../phpcr-migrations/Version201712041018.php | 1 - .../phpcr-migrations/Version201811091000.php | 1 - .../phpcr-migrations/Version201905071542.php | 1 - .../phpcr-migrations/Version202005151141.php | 1 - .../phpcr-migrations/Version202005191117.php | 1 - .../phpcr-migrations/Version202005250920.php | 1 - .../phpcr-migrations/Version202210140922.php | 1 - .../phpcr-migrations/Version202210241106.php | 1 - .../phpcr-migrations/Version202407111600.php | 1 - 11 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 Resources/phpcr-migrations/ContainerAwareInterface.php diff --git a/Resources/phpcr-migrations/ContainerAwareInterface.php b/Resources/phpcr-migrations/ContainerAwareInterface.php new file mode 100644 index 00000000..1eb672e9 --- /dev/null +++ b/Resources/phpcr-migrations/ContainerAwareInterface.php @@ -0,0 +1,29 @@ + Date: Tue, 27 Aug 2024 09:52:42 +0200 Subject: [PATCH 4/6] Fix code style --- .php-cs-fixer.dist.php | 15 +++++++++++++-- .../phpcr-migrations/ContainerAwareInterface.php | 9 +++++++++ .../phpcr-migrations/Version201811091000.php | 1 - .../phpcr-migrations/Version202005151141.php | 1 - .../phpcr-migrations/Version202005191117.php | 1 - .../phpcr-migrations/Version202005250920.php | 1 - .../phpcr-migrations/Version202210140922.php | 2 -- .../phpcr-migrations/Version202210241106.php | 1 - 8 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 78c1c466..910b496d 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,5 +1,14 @@ exclude(['Tests/Application/var/cache']) - ->in(__DIR__); + ->in(__DIR__) + ->ignoreDotFiles(false) + ->exclude(['tests/Application/var']) +; $config = new PhpCsFixer\Config(); $config->setRiskyAllowed(true) diff --git a/Resources/phpcr-migrations/ContainerAwareInterface.php b/Resources/phpcr-migrations/ContainerAwareInterface.php index 1eb672e9..5a63a884 100644 --- a/Resources/phpcr-migrations/ContainerAwareInterface.php +++ b/Resources/phpcr-migrations/ContainerAwareInterface.php @@ -1,5 +1,14 @@ container = $container; } - public function up(SessionInterface $session) { $liveSession = $this->container->get('sulu_document_manager.live_session'); diff --git a/Resources/phpcr-migrations/Version202005191117.php b/Resources/phpcr-migrations/Version202005191117.php index c5101cd5..7e66412e 100644 --- a/Resources/phpcr-migrations/Version202005191117.php +++ b/Resources/phpcr-migrations/Version202005191117.php @@ -31,7 +31,6 @@ public function setContainer(?ContainerInterface $container = null): void $this->container = $container; } - public function up(SessionInterface $session) { $liveSession = $this->container->get('sulu_document_manager.live_session'); diff --git a/Resources/phpcr-migrations/Version202005250920.php b/Resources/phpcr-migrations/Version202005250920.php index 081b72e5..9f7a645a 100644 --- a/Resources/phpcr-migrations/Version202005250920.php +++ b/Resources/phpcr-migrations/Version202005250920.php @@ -31,7 +31,6 @@ public function setContainer(?ContainerInterface $container = null): void $this->container = $container; } - public function up(SessionInterface $session) { $liveSession = $this->container->get('sulu_document_manager.live_session'); diff --git a/Resources/phpcr-migrations/Version202210140922.php b/Resources/phpcr-migrations/Version202210140922.php index de7e8e9d..f2730cda 100644 --- a/Resources/phpcr-migrations/Version202210140922.php +++ b/Resources/phpcr-migrations/Version202210140922.php @@ -15,7 +15,6 @@ use PHPCR\SessionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; - /** * Auto-generated Migration: Please modify to your needs! */ @@ -35,7 +34,6 @@ public function setContainer(?ContainerInterface $container = null): void $this->container = $container; } - public function up(SessionInterface $session) { $liveSession = $this->container->get('sulu_document_manager.live_session'); diff --git a/Resources/phpcr-migrations/Version202210241106.php b/Resources/phpcr-migrations/Version202210241106.php index 534d12b5..37fc5405 100644 --- a/Resources/phpcr-migrations/Version202210241106.php +++ b/Resources/phpcr-migrations/Version202210241106.php @@ -33,7 +33,6 @@ public function setContainer(?ContainerInterface $container = null): void $this->container = $container; } - public function up(SessionInterface $session) { $liveSession = $this->container->get('sulu_document_manager.live_session'); From 332f02e1a4784a6c5039408beb64bec847e1a129 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 27 Aug 2024 09:54:13 +0200 Subject: [PATCH 5/6] Fix code style --- .php-cs-fixer.dist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 910b496d..2e8f283c 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -21,7 +21,7 @@ $finder = PhpCsFixer\Finder::create() ->in(__DIR__) ->ignoreDotFiles(false) - ->exclude(['tests/Application/var']) + ->exclude(['Tests/Application/var']) ; $config = new PhpCsFixer\Config(); From 0dd4e13aa0c46e43ab6ab3fd12d2d1ab5f2f9e89 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 27 Aug 2024 09:55:57 +0200 Subject: [PATCH 6/6] Fix lint task --- Content/ArticleDataItem.php | 2 +- Content/ArticleDataProvider.php | 2 +- phpstan-baseline.neon | 30 ++++++++++-------------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/Content/ArticleDataItem.php b/Content/ArticleDataItem.php index 573594fc..7ecf58c0 100644 --- a/Content/ArticleDataItem.php +++ b/Content/ArticleDataItem.php @@ -66,6 +66,6 @@ public function getResource() public function getImage() { - return; + return null; } } diff --git a/Content/ArticleDataProvider.php b/Content/ArticleDataProvider.php index 8340d9ae..0951ccbb 100644 --- a/Content/ArticleDataProvider.php +++ b/Content/ArticleDataProvider.php @@ -225,7 +225,7 @@ public function resolveResourceItems( public function resolveDatasource($datasource, array $propertyParameter, array $options) { - return; + return null; } private function getWebspaceKey(array $propertyParameter, array $options): ?string diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7c51ed89..3faf98b4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -80,11 +80,6 @@ parameters: count: 1 path: Command/ReindexCommand.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataItem\\:\\:getImage\\(\\) should return string but empty return statement found\\.$#" - count: 1 - path: Content/ArticleDataItem.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataItem\\:\\:getResource\\(\\) has no return type specified\\.$#" count: 1 @@ -170,11 +165,6 @@ parameters: count: 1 path: Content/ArticleDataProvider.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\ArticleDataProvider\\:\\:resolveDatasource\\(\\) should return Sulu\\\\Component\\\\SmartContent\\\\DatasourceItemInterface but empty return statement found\\.$#" - count: 1 - path: Content/ArticleDataProvider.php - - message: "#^Negated boolean expression is always false\\.$#" count: 1 @@ -255,11 +245,6 @@ parameters: count: 1 path: Content/PageTreeArticleDataProvider.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Content\\\\PageTreeArticleDataProvider\\:\\:resolveDatasource\\(\\) should return Sulu\\\\Component\\\\SmartContent\\\\DatasourceItemInterface but returns null\\.$#" - count: 2 - path: Content/PageTreeArticleDataProvider.php - - message: "#^Parameter \\#1 \\$identifier of method Sulu\\\\Component\\\\DocumentManager\\\\DocumentManagerInterface\\:\\:find\\(\\) expects string, int\\\\|int\\<1, max\\>\\|string given\\.$#" count: 1 @@ -1905,11 +1890,6 @@ parameters: count: 1 path: Export/ArticleExport.php - - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Export\\\\ArticleExport\\:\\:__construct\\(\\) has parameter \\$formatFilePaths with no value type specified in iterable type array\\.$#" - count: 1 - path: Export/ArticleExport.php - - message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Export\\\\ArticleExport\\:\\:getDocuments\\(\\) should return Sulu\\\\Component\\\\DocumentManager\\\\Collection\\\\QueryResultCollection but returns mixed\\.$#" count: 1 @@ -2035,11 +2015,21 @@ parameters: count: 1 path: Import/ImportResult.php + - + message: "#^Parameter \\#1 \\$articleIds of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Infrastructure\\\\Sulu\\\\Headless\\\\DataProviderResolver\\\\AbstractArticleDataProviderResolver\\:\\:loadArticleStructures\\(\\) expects array\\, array\\, int\\|string\\> given\\.$#" + count: 1 + path: Infrastructure/Sulu/Headless/DataProviderResolver/AbstractArticleDataProviderResolver.php + - message: "#^Parameter \\#1 \\$filters of method Sulu\\\\Component\\\\SmartContent\\\\DataProviderInterface\\:\\:resolveResourceItems\\(\\) expects array\\{dataSource\\?\\: int\\|string\\|null, sortMethod\\?\\: 'asc'\\|'desc', sortBy\\?\\: string, tags\\?\\: array\\, tagOperator\\?\\: 'and'\\|'or', types\\?\\: array\\, categories\\?\\: array\\, categoryOperator\\?\\: 'and'\\|'or', \\.\\.\\.\\}, array given\\.$#" count: 1 path: Infrastructure/Sulu/Headless/DataProviderResolver/AbstractArticleDataProviderResolver.php + - + message: "#^Parameter \\#1 \\$articleIds of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Infrastructure\\\\SuluHeadlessBundle\\\\DataProviderResolver\\\\AbstractArticleDataProviderResolver\\:\\:loadArticleStructures\\(\\) expects array\\, array\\, int\\|string\\> given\\.$#" + count: 1 + path: Infrastructure/SuluHeadlessBundle/DataProviderResolver/AbstractArticleDataProviderResolver.php + - message: "#^Parameter \\#1 \\$filters of method Sulu\\\\Component\\\\SmartContent\\\\DataProviderInterface\\:\\:resolveResourceItems\\(\\) expects array\\{dataSource\\?\\: int\\|string\\|null, sortMethod\\?\\: 'asc'\\|'desc', sortBy\\?\\: string, tags\\?\\: array\\, tagOperator\\?\\: 'and'\\|'or', types\\?\\: array\\, categories\\?\\: array\\, categoryOperator\\?\\: 'and'\\|'or', \\.\\.\\.\\}, array given\\.$#" count: 1