diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..0880679 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,6 @@ +parameters: + ignoreErrors: + - + message: "#^Call to function is_array\\(\\) with Pimcore\\\\Config\\\\Config will always evaluate to false\\.$#" + count: 1 + path: src/Services/PerspectiveAccessor.php diff --git a/phpstan.neon b/phpstan.neon index 73729a8..0721488 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,4 +6,6 @@ parameters: bootstrapFiles: - phpstan-bootstrap.php excludePaths: - - src/Tests/* \ No newline at end of file + - src/Tests/* +includes: + - phpstan-baseline.neon \ No newline at end of file diff --git a/src/Services/PerspectiveAccessor.php b/src/Services/PerspectiveAccessor.php index 05eaeae..6065d97 100644 --- a/src/Services/PerspectiveAccessor.php +++ b/src/Services/PerspectiveAccessor.php @@ -92,8 +92,11 @@ protected function convertTreeStoreToConfiguration($treeStore) public function getConfiguration(): array { $config = \Pimcore\Perspective\Config::get(); - - return $config->toArray(); + if (is_array($config)) { + return $config; + } else { + return $config->toArray(); + } } public function writeConfiguration($treeStore, ?array $deletedRecords)