Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/ci/files/config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ security:
id: Pimcore\Security\User\UserProvider

firewalls:
pimcore_studio: '%pimcore_studio_backend.firewall_settings%'
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
Expand All @@ -15,16 +16,10 @@ security:
http_basic: ~

access_control:
# Pimcore admin ACl // DO NOT CHANGE!
- { path: ^/admin/settings/display-custom-logo, roles: PUBLIC_ACCESS }
- { path: ^/admin/login/2fa-verify, roles: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/admin/login/2fa-setup, roles: ROLE_PIMCORE_USER }
- { path: ^/admin/login/2fa, roles: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/admin/login$, roles: PUBLIC_ACCESS }
- { path: ^/admin/login/(login|lostpassword|deeplink|csrf-token)$, roles: PUBLIC_ACCESS }
- { path: ^/admin, roles: ROLE_PIMCORE_USER }
- { path: ^/pimcore-studio/api/(docs|docs/json|translations|user/reset-password)$, roles: PUBLIC_ACCESS }
- { path: ^/pimcore-studio/api, roles: ROLE_PIMCORE_USER }
- { path: ^/asset/webdav, roles: ROLE_PIMCORE_USER }

role_hierarchy:
# Pimcore admin // DO NOT CHANGE!
ROLE_PIMCORE_ADMIN: [ROLE_PIMCORE_USER]
ROLE_PIMCORE_ADMIN: [ROLE_PIMCORE_USER]
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"friendsofphp/proxy-manager-lts": "^1"
},
"require-dev": {
"phpstan/phpstan": "1.12.15",
"phpstan/phpstan-symfony": "^1.2.20",
"phpstan/phpstan": "2.1.40",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^10.2",
"codeception/codeception": "^5.0.10",
"codeception/module-symfony":"^3.1.1",
"codeception/phpunit-wrapper": "^9",
"codeception/codeception": "^5.3.1",
"codeception/module-symfony":"^3.7.1",
"codeception/phpunit-wrapper": "^10",
"codeception/module-asserts": "^2",
"fakerphp/faker": "^1.23"
},
Expand Down
19 changes: 16 additions & 3 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
path: src/Proxy/Events/ProxyEvent.php

-
message: "#^Parameter \\#1 \\$returnType of method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\Proxy\\\\Events\\\\ProxyEvent\\:\\:getTypeArray\\(\\) expects ReflectionIntersectionType\\|ReflectionNamedType\\|ReflectionUnionType\\|null, ReflectionType\\|null given\\.$#"
message: "#^Parameter \\#1 \\$returnType of method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\Proxy\\\\Events\\\\ProxyEvent\\:\\:getTypeArray\\(\\) expects ReflectionIntersectionType\\|ReflectionNamedType\\|ReflectionUnionType\\|null, ReflectionType(\\|null)? given\\.$#"
count: 1
path: src/Proxy/Events/ProxyEvent.php

Expand All @@ -16,7 +16,7 @@ parameters:
path: src/Proxy/Events/ProxyPreInterceptor.php

-
message: "#^Parameter \\#1 \\$returnType of method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\Proxy\\\\Events\\\\ProxyPreInterceptor\\:\\:getTypeArray\\(\\) expects ReflectionIntersectionType\\|ReflectionNamedType\\|ReflectionUnionType\\|null, ReflectionType\\|null given\\.$#"
message: "#^Parameter \\#1 \\$returnType of method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\Proxy\\\\Events\\\\ProxyPreInterceptor\\:\\:getTypeArray\\(\\) expects ReflectionIntersectionType\\|ReflectionNamedType\\|ReflectionUnionType\\|null, ReflectionType(\\|null)? given\\.$#"
count: 1
path: src/Proxy/Events/ProxyPreInterceptor.php

Expand All @@ -28,4 +28,17 @@ parameters:
-
message: "#^Unable to resolve the template type RealObjectType in call to method ProxyManager\\\\Factory\\\\RemoteObjectFactory\\:\\:createProxy\\(\\)$#"
count: 2
path: src/Proxy/Factory/RemoteObject/RemoteObjectFactory.php
path: src/Proxy/Factory/RemoteObject/RemoteObjectFactory.php

-
message: "#^Method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\DependencyInjection\\\\Configuration\\:\\:getConfigTreeBuilder\\(\\) return type with generic class Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder does not specify its types\\: T$#"
count: 1
path: DependencyInjection/Configuration.php

-
message: "#^Method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\.* has parameter .* with no value type specified in iterable type array\\.$#"
path: **

-
message: "#^Method Pimcore\\\\Bundle\\\\StaticResolverBundle\\\\.* return type has no value type specified in iterable type array\\.$#"
path: **
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
parameters:
level: 6
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
paths:
- src
bootstrapFiles:
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
{
/**
* {@inheritdoc}
*
* @return TreeBuilder<'array'>

Check warning on line 29 in src/DependencyInjection/Configuration.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the useless trailing whitespaces at the end of this line.

See more on https://sonarcloud.io/project/issues?id=pimcore_static-resolver-bundle&issues=AZznADP9uFpMS3d4zrN8&open=AZznADP9uFpMS3d4zrN8&pullRequest=130
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand Down
6 changes: 1 addition & 5 deletions src/PimcoreStaticResolverBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
use function dirname;
use Pimcore\Bundle\StaticResolverBundle\DependencyInjection\PimcoreStaticResolverExtension;
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface;
use Pimcore\Extension\Bundle\Traits\BundleAdminClassicTrait;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;

class PimcoreStaticResolverBundle extends AbstractPimcoreBundle implements PimcoreBundleAdminClassicInterface
class PimcoreStaticResolverBundle extends AbstractPimcoreBundle
{
use BundleAdminClassicTrait;

public function getContainerExtension(): ExtensionInterface
{
return new PimcoreStaticResolverExtension();
Expand Down
2 changes: 1 addition & 1 deletion src/Proxy/Adapter/Remote/StrictObjectAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ private function methodIsPublic(string $method): bool
// @codeCoverageIgnoreEnd
}

return !(!is_object($reflection) || !$reflection->isPublic());
return $reflection->isPublic();
}
}
4 changes: 2 additions & 2 deletions src/Proxy/Events/ProxyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private function checkReturnType(mixed $response): void

$returnType = $method->getReturnType();

if ($response === null && $returnType?->allowsNull()) {
if ($response === null && $returnType->allowsNull()) {
return;
}

Expand Down Expand Up @@ -137,7 +137,7 @@ private function addSpecialTypes(array $returnTypeArray): array
* @return array
*/
private function getTypeArray(
ReflectionIntersectionType|ReflectionNamedType|ReflectionUnionType|null $returnType
\ReflectionType|null $returnType
): array {
$returnTypeArray = [];
if ($returnType instanceof ReflectionUnionType || $returnType instanceof ReflectionIntersectionType) {
Expand Down
4 changes: 2 additions & 2 deletions src/Proxy/Events/ProxyPreInterceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private function checkReturnType(mixed $response): void

$returnType = $method->getReturnType();

if ($response === null && $returnType?->allowsNull()) {
if ($response === null && $returnType->allowsNull()) {
return;
}

Expand Down Expand Up @@ -155,7 +155,7 @@ private function addSpecialTypes(array $returnTypeArray): array
* @return array
*/
private function getTypeArray(
ReflectionIntersectionType|ReflectionNamedType|ReflectionUnionType|null $returnType
\ReflectionType|null $returnType
): array {
$returnTypeArray = [];
if ($returnType instanceof ReflectionUnionType || $returnType instanceof ReflectionIntersectionType) {
Expand Down
Loading