Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/upstream/master' into 3.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	phpstan.neon
  • Loading branch information
oleg-andreyev committed Jul 12, 2024
2 parents 9e4f870 + 0a35944 commit 98125b6
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-3.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test": "php -d pcov.enabled=1 ./vendor/bin/phpunit --colors=always",
"csfixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no --verbose --ansi",
"cs-check": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no --verbose --ansi --dry-run",
"phpstan": "php -d memory_limit=1G ./tools/phpstan/vendor/bin/phpstan --ansi analyse src",
"phpstan": "tools/phpstan/vendor/bin/phpstan --memory-limit=1G --ansi analyse src",
"rector": "tools/rector/vendor/bin/rector",
"rector-check": "tools/rector/vendor/bin/rector --dry-run",
"update-tools": "composer update --working-dir=tools/php-cs-fixer ; composer update --working-dir=tools/phpstan ; composer update --working-dir=tools/rector"
Expand Down
5 changes: 3 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
parameters:
level: max
inferPrivatePropertyTypeFromConstructor: true
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false

type_coverage:
return_type: 100
param_type: 100
Expand All @@ -12,6 +11,8 @@ parameters:
- src

ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
# false positives
- '~Dead catch - Throwable is never thrown in the try block~'
- '~Parameter \#1 \$className of method Doctrine\\ORM\\EntityManagerInterface\:\:getClassMetadata\(\) expects class-string<object>, string given\.~'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ private function getEntityConfiguration(ClassMetadata $metadata): ?array

private function getAllProperties(ReflectionClass $reflection): array
{
$annotationProperty = null;
$properties = [];

foreach ($reflection->getProperties() as $property) {
$annotationProperty = null;
$attributes = $property->getAttributes(Ignore::class);
if (\is_array($attributes) && [] !== $attributes) {
$annotationProperty = $attributes[0]->newInstance();
Expand Down
4 changes: 2 additions & 2 deletions src/Provider/Doctrine/Persistence/Helper/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static function getRealClassName(object|string $subject): string

// __CG__: Doctrine Common Marker for Proxy (ODM < 2.0 and ORM < 3.0)
// __PM__: Ocramius Proxy Manager (ODM >= 2.0)
$positionCg = mb_strrpos($subject, '\\__CG__\\');
$positionPm = mb_strrpos($subject, '\\__PM__\\');
$positionCg = mb_strrpos($subject, '\__CG__\\');
$positionPm = mb_strrpos($subject, '\__PM__\\');
if (false === $positionCg && false === $positionPm) {
return $subject;
}
Expand Down
1 change: 1 addition & 0 deletions tests/Provider/Doctrine/DoctrineProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ public function testLoadEntitiesWithAttributesOnly(): void
self::assertFalse($provider->isAuditedField(AuditedEntityWithAttribute::class, 'ignoredField'), 'Field "'.AuditedEntityWithAttribute::class.'::$ignoredField" is ignored.');
self::assertFalse($provider->isAuditedField(AuditedEntityWithAttribute::class, 'ignoredProtectedField'), 'Field "'.AuditedEntityWithAttribute::class.'::$ignoredProtectedField" is ignored.');
self::assertFalse($provider->isAuditedField(AuditedEntityWithAttribute::class, 'ignoredPrivateField'), 'Field "'.AuditedEntityWithAttribute::class.'::$ignoredPrivateField" is ignored.');
self::assertTrue($provider->isAuditedField(AuditedEntityWithAttribute::class, 'id'), 'Field "'.AuditedEntityWithAttribute::class.'::$id" is audited.');
}

#[Depends('testIsAuditedHonorsEnabledFlag')]
Expand Down
Loading

0 comments on commit 98125b6

Please sign in to comment.