Skip to content

Commit

Permalink
update php and pimcore, fix deprecations (#68)
Browse files Browse the repository at this point in the history
* update php and pimcore, fix deprecations
  • Loading branch information
alexz707 authored Jan 17, 2025
1 parent 86060a2 commit 1607e92
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
strategy:
matrix:
include:
- { php-version: "8.1", dependencies: "lowest", experimental: false }
- { php-version: "8.2", dependencies: "highest", pimcore_version: "", experimental: false }
- { php-version: "8.2", dependencies: "highest", pimcore_version: "11.x-dev as 11.0.0", experimental: true }
- { php-version: "8.3", dependencies: "lowest", experimental: false }
- { php-version: "8.4", dependencies: "highest", experimental: false }
- { php-version: "8.4", dependencies: "highest", pimcore_version: "12.x-dev as 12.0.0", experimental: true }
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
uses: actions/checkout@v2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
Expand All @@ -47,9 +47,9 @@ jobs:
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: ramsey/composer-install@v2
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan.neon --memory-limit=-1"
run: vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan.neon --memory-limit=-1
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
}
},
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"pimcore/pimcore": "^11.0",
"pimcore/pimcore": "^11.0 || 12.x-dev",
"symfony/config": "^6.1",
"symfony/dependency-injection": "^6.1",
"symfony/event-dispatcher": "^6.1",
"symfony/event-dispatcher-contracts": "^3.0",
"symfony/security-core": "^6.1"
},
"conflict": {
"pimcore/pimcore": "<11.0.0-ALPHA6"
},
"require-dev": {
"phpstan/phpstan": "^1.10"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected function cleanupAndCheckForEmpty($data)
return $cleanData;
}

public function getDataForEditmode(mixed $data, DataObject\Concrete $object = null, array $params = []): mixed
public function getDataForEditmode(mixed $data, ?DataObject\Concrete $object = null, array $params = []): mixed
{
$permissions = $this->getPermissionResources();
foreach ($permissions as $permission) {
Expand All @@ -144,12 +144,12 @@ public function getDataForEditmode(mixed $data, DataObject\Concrete $object = nu
return $data;
}

public function getDataFromEditmode(mixed $data, DataObject\Concrete $object = null, array $params = []): mixed
public function getDataFromEditmode(mixed $data, ?DataObject\Concrete $object = null, array $params = []): mixed
{
return $data;
}

public function getDataForQueryResource(mixed $data, Concrete $object = null, array $params = []): mixed
public function getDataForQueryResource(mixed $data, ?Concrete $object = null, array $params = []): mixed
{
$data = $this->cleanupAndCheckForEmpty($data);
if (is_array($data)) {
Expand All @@ -159,12 +159,12 @@ public function getDataForQueryResource(mixed $data, Concrete $object = null, ar
return '';
}

public function getDataForResource(mixed $data, Concrete $object = null, array $params = []): mixed
public function getDataForResource(mixed $data, ?Concrete $object = null, array $params = []): mixed
{
return Serialize::serialize($this->cleanupAndCheckForEmpty($data));
}

public function getDataFromResource(mixed $data, Concrete $object = null, array $params = []): mixed
public function getDataFromResource(mixed $data, ?Concrete $object = null, array $params = []): mixed
{
return $this->cleanupAndCheckForEmpty(Serialize::unserialize($data));
}
Expand Down Expand Up @@ -258,7 +258,7 @@ public function getDiffVersionPreview($data, $object = null, $params = [])
}
}

public function getVersionPreview(mixed $data, DataObject\Concrete $object = null, array $params = []): string
public function getVersionPreview(mixed $data, ?DataObject\Concrete $object = null, array $params = []): string
{
$versionPreview = $this->getDiffVersionPreview($data, $object, $params);
if (is_array($versionPreview) && $versionPreview['html']) {
Expand Down
6 changes: 3 additions & 3 deletions src/CoreExtensions/ClassDefinitions/PermissionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ protected function checkForEmpty($data)
return $data;
}

public function getDataForResource(mixed $data, Concrete $object = null, array $params = []): ?string
public function getDataForResource(mixed $data, ?Concrete $object = null, array $params = []): ?string
{
return $this->checkForEmpty($data);
}

public function getDataFromResource(mixed $data, Concrete $object = null, array $params = []): ?string
public function getDataFromResource(mixed $data, ?Concrete $object = null, array $params = []): ?string
{
return $this->checkForEmpty($data);
}

public function getDataForQueryResource(mixed $data, Concrete $object = null, array $params = []): ?string
public function getDataForQueryResource(mixed $data, ?Concrete $object = null, array $params = []): ?string
{
return $this->checkForEmpty($data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CoreExtensions/Navigation/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Builder extends \Pimcore\Navigation\Builder
*/
protected $currentUser;

public function __construct(RequestHelper $requestHelper, string $pageClass = null)
public function __construct(RequestHelper $requestHelper, ?string $pageClass = null)
{
parent::__construct($requestHelper, $pageClass);
}
Expand Down

0 comments on commit 1607e92

Please sign in to comment.