Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 3.4.x up into 4.0.x #359

Merged
merged 10 commits into from
May 18, 2024
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "CI"
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.0.0"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1"
with:
composer-root-version: "3.0"
4 changes: 3 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ on:
jobs:
phpunit:
name: "PHPUnit"
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@3.0.0"
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@5.0.1"
with:
composer-root-version: "3.0"
php-versions: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]'
secrets:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@3.0.0"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.0.1"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ on:
jobs:
static-analysis:
name: "Static Analysis"
uses: "doctrine/.github/.github/workflows/static-analysis.yml@3.0.0"
uses: "doctrine/.github/.github/workflows/static-analysis.yml@5.0.1"
with:
composer-root-version: "3.0"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"doctrine/common": "^3.0",
"phpunit/phpunit": "^8.5 || ^9.5",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"vimeo/psalm": "4.30.0 || 5.3.0"
"vimeo/psalm": "4.30.0 || 5.24.0"
},
"conflict": {
"doctrine/common": "<2.10"
Expand Down
29 changes: 17 additions & 12 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.3.0@b6faa3e96b8eb50ec71384c53799b8a107236bb6">
<file src="src/Persistence/AbstractManagerRegistry.php">
<PossiblyNullReference occurrences="1">
<code>getName</code>
</PossiblyNullReference>
<TypeDoesNotContainType occurrences="1">
<code>$parentClass === false</code>
</TypeDoesNotContainType>
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<file src="src/Persistence/Mapping/AbstractClassMetadataFactory.php">
<ArgumentTypeCoercion>
<code><![CDATA[$class]]></code>
</ArgumentTypeCoercion>
</file>
<file src="src/Persistence/Mapping/Driver/SymfonyFileLocator.php">
<PossiblyInvalidOperand>
<code><![CDATA[str_replace($this->nsSeparator, '\\', $fileName)]]></code>
</PossiblyInvalidOperand>
</file>
<file src="src/Persistence/Reflection/EnumReflectionProperty.php">
<InvalidReturnStatement occurrences="1">
<code>$value</code>
<InvalidArgument>
<code><![CDATA[$name]]></code>
</InvalidArgument>
<InvalidReturnStatement>
<code><![CDATA[$value]]></code>
</InvalidReturnStatement>
<PossiblyInvalidArgument occurrences="1">
<code>$value</code>
<PossiblyInvalidArgument>
<code><![CDATA[$value]]></code>
</PossiblyInvalidArgument>
</file>
</files>
10 changes: 10 additions & 0 deletions src/Persistence/Reflection/EnumReflectionProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,14 @@ public function getDocComment(): string|false
{
return $this->originalReflectionProperty->getDocComment();
}

/**
* {@inheritDoc}
*
* @psalm-external-mutation-free
*/
public function isPrivate(): bool
{
return $this->originalReflectionProperty->isPrivate();
}
}
1 change: 1 addition & 0 deletions src/Persistence/Reflection/RuntimeReflectionProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class RuntimeReflectionProperty extends ReflectionProperty
/** @var string */
private $key;

/** @param class-string $class */
public function __construct(string $class, string $name)
{
parent::__construct($class, $name);
Expand Down
4 changes: 2 additions & 2 deletions tests/Persistence/RuntimePublicReflectionPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testGetValueOnProxyPublicProperty(): void
$mockProxy->__setInitializer($initializer);

$reflProperty = new RuntimePublicReflectionProperty(
__NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock',
RuntimePublicReflectionPropertyTestProxyMock::class,
'checkedProperty'
);

Expand All @@ -82,7 +82,7 @@ public function testSetValueOnProxyPublicProperty(): void
$mockProxy->__setInitializer($initializer);

$reflProperty = new RuntimePublicReflectionProperty(
__NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock',
RuntimePublicReflectionPropertyTestProxyMock::class,
'checkedProperty'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ public function testGetDocComment(): void
$reflProperty = new EnumReflectionProperty(new ReflectionProperty(TypedEnumClass::class, 'suit'), Suit::class);
self::assertStringContainsString('@MyDoc', $reflProperty->getDocComment());
}

public function testIsPrivate(): void
{
$reflProperty = new EnumReflectionProperty(new ReflectionProperty(TypedEnumClass::class, 'suit'), Suit::class);
self::assertFalse($reflProperty->isPrivate());
}
}

#[Attribute(Attribute::TARGET_PROPERTY)]
Expand Down