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
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@13.1.0"
2 changes: 1 addition & 1 deletion .github/workflows/composer-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ on:
jobs:
composer-lint:
name: "Composer Lint"
uses: "doctrine/.github/.github/workflows/composer-lint.yml@5.0.1"
uses: "doctrine/.github/.github/workflows/composer-lint.yml@13.1.0"
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
phpunit:
name: "PHPUnit"
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@5.0.1"
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@13.1.0"
with:
php-versions: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]'
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ on:
jobs:
documentation:
name: "Documentation"
uses: "doctrine/.github/.github/workflows/documentation.yml@5.1.0"
uses: "doctrine/.github/.github/workflows/documentation.yml@13.1.0"
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@5.0.1"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@13.1.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ on:
- "*.x"

jobs:
static-analysis:
phpstan:
name: "Static Analysis"
uses: "doctrine/.github/.github/workflows/[email protected]"
uses: "doctrine/.github/.github/workflows/[email protected]"

psalm:
name: "Psalm (PHP: 8.2)"
runs-on: "ubuntu-22.04"

steps:
- name: "Checkout code"
uses: "actions/checkout@v6"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.2"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "doctrine/annotations",
"abandoned": true,
"description": "Docblock Annotations Parser",
"license": "MIT",
"type": "library",
"abandoned": true,
"keywords": [
"annotations",
"docblock",
Expand Down Expand Up @@ -39,11 +39,10 @@
"psr/cache": "^1 || ^2 || ^3"
},
"require-dev": {
"doctrine/cache": "^2.0",
"doctrine/coding-standard": "^10",
"phpstan/phpstan": "^1.10.28",
"doctrine/coding-standard": "^11.1 || ^14",
"phpstan/phpstan": "^1.11 || ^2.1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"symfony/cache": "^5.4 || ^6.4 || ^7",
"symfony/cache": "^5.4 || ^6.4 || ^7.4 || ^8",
"vimeo/psalm": "^4.30 || ^5.14"
},
"suggest": {
Expand Down
5 changes: 5 additions & 0 deletions docs/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"doctrine/docs-builder": "^1.0"
}
}
9 changes: 9 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine.MultipleUsesPerLine">
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/Fixtures/*</exclude-pattern>
</rule>
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing">
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/Fixtures/*</exclude-pattern>
</rule>
<rule ref="Squiz.Classes.ValidClassName">
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/Fixtures/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/Fixtures/*</exclude-pattern>
</rule>

<!-- https://github.com/slevomat/coding-standard/issues/1066 -->
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses">
Expand Down
8 changes: 4 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
level: 3
phpVersion: 80200
phpVersion: 80500
paths:
- lib
- tests
Expand All @@ -14,12 +14,12 @@ parameters:
- tests/Doctrine/Tests/Common/Annotations/ReservedKeywordsClasses.php
- tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php
- tests/Doctrine/Tests/DoctrineTestCase.php
- tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php
polluteScopeWithLoopInitialAssignments: true
ignoreErrors:
- '#Instantiated class Doctrine_Tests_Common_Annotations_Fixtures_ClassNoNamespaceNoComment not found#'
- '#Property Doctrine\\Tests\\Common\\Annotations\\DummyClassNonAnnotationProblem::\$foo has unknown class#'
- '#Call to an undefined static method PHPUnit\\Framework\\TestCase::expectExceptionMessageRegExp\(\)#'

# That tag is empty on purpose
- '#PHPDoc tag @var has invalid value \(\)\: Unexpected token "\*/", expected type at offset 9#'
-
identifier: phpDoc.parseError
path: tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php
10 changes: 8 additions & 2 deletions tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ private function updateFieldAceProperty($name, array $changes): void
$this->loadedAces[$aceId] = $ace;

$aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id');
$aceIdProperty->setAccessible(true);
if (PHP_VERSION_ID < 80100) {
$aceIdProperty->setAccessible(true);
}

$aceIdProperty->setValue($ace, (int) $aceId);
} else {
$currentIds[$ace->getId()] = true;
Expand Down Expand Up @@ -274,7 +277,10 @@ private function updateAceProperty($name, array $changes): void
$this->loadedAces[$aceId] = $ace;

$aceIdProperty = new \ReflectionProperty($ace, 'id');
$aceIdProperty->setAccessible(true);
if (PHP_VERSION_ID < 80100) {
$aceIdProperty->setAccessible(true);
}

$aceIdProperty->setValue($ace, (int) $aceId);
} else {
$currentIds[$ace->getId()] = true;
Expand Down
12 changes: 10 additions & 2 deletions tests/Doctrine/Tests/Common/Annotations/PsrCachedReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use function time;
use function touch;

use const PHP_VERSION_ID;

final class PsrCachedReaderTest extends AbstractReaderTest
{
/** @var CacheItemPoolInterface */
Expand Down Expand Up @@ -124,11 +126,17 @@ public function testPurgeLoadedAnnotations(): void
$classReader = new ReflectionClass(PsrCachedReader::class);

$loadedAnnotationsProperty = $classReader->getProperty('loadedAnnotations');
$loadedAnnotationsProperty->setAccessible(true);
if (PHP_VERSION_ID < 80100) {
$loadedAnnotationsProperty->setAccessible(true);
}

$this->assertCount(1, $loadedAnnotationsProperty->getValue($reader));

$loadedFilemtimesProperty = $classReader->getProperty('loadedFilemtimes');
$loadedFilemtimesProperty->setAccessible(true);
if (PHP_VERSION_ID < 80100) {
$loadedFilemtimesProperty->setAccessible(true);
}

$this->assertCount(3, $loadedFilemtimesProperty->getValue($reader));

$reader->clearLoadedAnnotations();
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/TestInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file bootstraps the test environment.
*/
error_reporting(E_ALL | E_STRICT);
error_reporting(E_ALL);

// register silently failing autoloader
spl_autoload_register(static function ($class) {
Expand Down
Loading