Skip to content

Commit

Permalink
[Task]: Remove Pimcore\Config\Config (#93)
Browse files Browse the repository at this point in the history
* [Task]: Remove Pimcore\Config\Config

* Apply php-cs-fixer changes

* [Task]: Remove Pimcore\Config\Config

* [Task]: Remove Pimcore\Config\Config

* [Task]: Remove Pimcore\Config\Config

Co-authored-by: mcop1 <[email protected]>
  • Loading branch information
mcop1 and mcop1 committed Sep 13, 2022
1 parent 5b77bfe commit 01b499e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ parameters:
bootstrapFiles:
- phpstan-bootstrap.php
excludePaths:
- src/Tests/*
- src/Tests/*
includes:
- phpstan-baseline.neon
7 changes: 5 additions & 2 deletions src/Services/PerspectiveAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 01b499e

Please sign in to comment.