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/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
name: "PHPUnit"
uses: "doctrine/.github/.github/workflows/[email protected]"
with:
php-versions: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]'
php-versions: '["8.1", "8.2", "8.3"]'
secrets:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ awareness about deprecated code.

# Upgrade to 4.0

## BC Break: Added type declarations

The code base is now fully typed, meaning properties, parameters and return
type declarations have been added to all types.

## BC Break: Dropped support for Common proxies

Proxy objects implementing the `Doctrine\Common\Proxy\Proxy` interface are not
Expand Down
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{"name": "Marco Pivetta", "email": "[email protected]"}
],
"require": {
"php": "^7.2 || ^8.0",
"php": "^8.1",
"doctrine/event-manager": "^1 || ^2",
"psr/cache": "^1.0 || ^2.0 || ^3.0"
},
Expand All @@ -29,7 +29,7 @@
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan-strict-rules": "^1.1",
"doctrine/coding-standard": "^12",
"phpunit/phpunit": "^8.5 || ^9.5",
"phpunit/phpunit": "^9.6",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"vimeo/psalm": "4.30.0 || 5.24.0"
},
Expand All @@ -43,9 +43,7 @@
},
"autoload-dev": {
"psr-4": {
"Doctrine\\Tests\\": "tests",
"Doctrine\\Tests_PHP74\\": "tests_php74",
"Doctrine\\Tests_PHP81\\": "tests_php81"
"Doctrine\\Tests\\": "tests"
}
},
"config": {
Expand Down
18 changes: 1 addition & 17 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,15 @@
<!-- Ignore warnings and show progress of the run -->
<arg value="nps"/>

<config name="php_version" value="70200"/>
<config name="php_version" value="80100"/>

<file>src</file>
<file>tests</file>

<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint"/>
<exclude name="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly.ReferencedGeneralException"/>
</rule>

<!-- Disable the rules that will require PHP 7.4 -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<properties>
<property name="enableNativeTypeHint" value="false"/>
</properties>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
<exclude-pattern>src/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
<exclude-pattern>src/*</exclude-pattern>
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
Expand Down
47 changes: 26 additions & 21 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -36,51 +36,56 @@ parameters:
path: tests/Persistence/Mapping/DriverChainTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\stdClass', 'Foo\\\\\\\\sub\\\\\\\\subClass', 'Foo\\\\\\\\sub\\\\\\\\subsub…'\\} and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
count: 1
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Doctrine\\\\\\\\Persistence\\\\\\\\Reflection\\\\\\\\RuntimeReflectionProperty' and Doctrine\\\\Persistence\\\\Reflection\\\\RuntimeReflectionProperty will always evaluate to true\\.$#"
count: 3
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\<int, 'Foo\\\\\\\\Bar\\\\\\\\subDirClass'\\|'Foo\\\\\\\\global'\\|'Foo\\\\\\\\stdClass'\\> and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'ReflectionProperty' and Doctrine\\\\Persistence\\\\Reflection\\\\RuntimeReflectionProperty will always evaluate to true\\.$#"
count: 5
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php

-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$nonTypedDefaultProperty is never read, only written\\.$#"
count: 1
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\<int, 'Foo\\\\\\\\Bar\\\\\\\\subDirClass'\\|'Foo\\\\\\\\stdClass'\\> and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$nonTypedNoDefaultProperty is unused\\.$#"
count: 1
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php

-
message: "#^Method Doctrine\\\\Tests\\\\Persistence\\\\RuntimeReflectionPropertyTestProxyMock\\:\\:__setInitialized\\(\\) has parameter \\$initialized with no type specified\\.$#"
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$typedDefaultProperty is never read, only written\\.$#"
count: 1
path: tests/Persistence/RuntimeReflectionPropertyTest.php
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php

-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\RuntimeReflectionPropertyTestProxyMock\\:\\:\\$checkedProperty \\(string\\) in isset\\(\\) is not nullable\\.$#"
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$typedNoDefaultProperty is unused\\.$#"
count: 1
path: tests/Persistence/RuntimeReflectionPropertyTest.php
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php

-
message: "#^Property Doctrine\\\\Tests_PHP74\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$nonTypedDefaultProperty is never read, only written\\.$#"
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\stdClass', 'Foo\\\\\\\\sub\\\\\\\\subClass', 'Foo\\\\\\\\sub\\\\\\\\subsub…'\\} and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
count: 1
path: tests_php74/Persistence/Mapping/RuntimeReflectionServiceTest.php
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php

-
message: "#^Property Doctrine\\\\Tests_PHP74\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$nonTypedNoDefaultProperty is unused\\.$#"
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\<int, 'Foo\\\\\\\\Bar\\\\\\\\subDirClass'\\|'Foo\\\\\\\\global'\\|'Foo\\\\\\\\stdClass'\\> and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
count: 1
path: tests_php74/Persistence/Mapping/RuntimeReflectionServiceTest.php
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php

-
message: "#^Property Doctrine\\\\Tests_PHP74\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$typedDefaultProperty is never read, only written\\.$#"
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\<int, 'Foo\\\\\\\\Bar\\\\\\\\subDirClass'\\|'Foo\\\\\\\\stdClass'\\> and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
count: 1
path: tests_php74/Persistence/Mapping/RuntimeReflectionServiceTest.php
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php

-
message: "#^Property Doctrine\\\\Tests_PHP74\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$typedNoDefaultProperty is unused\\.$#"
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Reflection\\\\TypedFoo\\:\\:\\$id is never read, only written\\.$#"
count: 1
path: tests_php74/Persistence/Mapping/RuntimeReflectionServiceTest.php
path: tests/Persistence/Reflection/TypedNoDefaultReflectionPropertyTest.php

-
message: "#^Property Doctrine\\\\Tests_PHP74\\\\Persistence\\\\Reflection\\\\TypedFoo\\:\\:\\$id is never read, only written\\.$#"
message: "#^Method Doctrine\\\\Tests\\\\Persistence\\\\RuntimeReflectionPropertyTestProxyMock\\:\\:__setInitialized\\(\\) has parameter \\$initialized with no type specified\\.$#"
count: 1
path: tests_php74/Persistence/Reflection/TypedNoDefaultReflectionPropertyTest.php
path: tests/Persistence/RuntimeReflectionPropertyTest.php
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ parameters:
paths:
- src
- tests
- tests_php74

excludePaths:
- tests/Persistence/Mapping/_files/Doctrine.Tests.Persistence.Mapping.PHPTestEntity.php
Expand Down
2 changes: 0 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<testsuites>
<testsuite name="Doctrine Persistence Test Suite">
<directory>tests</directory>
<directory phpVersion="7.4" phpVersionOperator=">=">tests_php74</directory>
<directory phpVersion="8.1" phpVersionOperator=">=">tests_php81</directory>
</testsuite>
</testsuites>

Expand Down
24 changes: 24 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,32 @@
<InvalidReturnStatement>
<code><![CDATA[$value]]></code>
</InvalidReturnStatement>
<MethodSignatureMismatch>
<code><![CDATA[$object]]></code>
</MethodSignatureMismatch>
<PossiblyInvalidArgument>
<code><![CDATA[$value]]></code>
</PossiblyInvalidArgument>
</file>
<file src="src/Persistence/Reflection/RuntimeReflectionProperty.php">
<MethodSignatureMismatch>
<code><![CDATA[$object]]></code>
</MethodSignatureMismatch>
</file>
<file src="src/Persistence/Reflection/TypedNoDefaultReflectionProperty.php">
<MethodSignatureMismatch>
<code><![CDATA[$object]]></code>
</MethodSignatureMismatch>
</file>
<file src="tests/Persistence/Mapping/DriverChainTest.php">
<TypeDoesNotContainType>
<code><![CDATA[assertSame]]></code>
</TypeDoesNotContainType>
</file>
<file src="tests/Persistence/Reflection/Reflection/EnumReflectionPropertyTest.php">
<TypeDoesNotContainNull>
<code><![CDATA[assertNull]]></code>
<code><![CDATA[assertNull]]></code>
</TypeDoesNotContainNull>
</file>
</files>
Loading