Skip to content

Commit

Permalink
Merge branch 'doctrine:3.3.x' into dev-prefix-cache-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adambalint-srg authored Jun 13, 2024
2 parents f8c7ef1 + bf7aab0 commit 46d44c5
Show file tree
Hide file tree
Showing 24 changed files with 262 additions and 63 deletions.
18 changes: 10 additions & 8 deletions .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
"docsSlug": "doctrine-persistence",
"versions": [
{
"name": "3.3",
"branchName": "3.3.x",
"name": "3.4",
"branchName": "3.4.x",
"slug": "latest",
"upcoming": true
},
{
"name": "3.3",
"branchName": "3.3.x",
"slug": "3.3",
"current": true
},
{
"name": "3.2",
"branchName": "3.2.x",
"slug": "3.2",
"current": true,
"aliases": [
"current",
"stable"
]
"maintained": false
},
{
"name": "3.1",
Expand All @@ -36,7 +38,7 @@
"name": "2.5",
"branchName": "2.5.x",
"slug": "2.5",
"maintained": true
"maintained": false
},
{
"name": "2.4",
Expand Down
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"
6 changes: 4 additions & 2 deletions .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"]'
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"
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Doctrine Persistence

[![Build Status](https://travis-ci.org/doctrine/persistence.svg)](https://travis-ci.org/doctrine/persistence)
[![Code Coverage](https://codecov.io/gh/doctrine/persistence/branch/2.1.x/graph/badge.svg)](https://codecov.io/gh/doctrine/persistence/branch/2.1.x)
[![GitHub Actions][GA 3.3 image]][GA 3.3]
[![Code Coverage][Coverage 3.3 image]][CodeCov 3.3]

The Doctrine Persistence project is a library that provides common abstractions for object mapper persistence.

Expand All @@ -10,3 +10,8 @@ The Doctrine Persistence project is a library that provides common abstractions
* [Website](https://www.doctrine-project.org/)
* [Documentation](https://www.doctrine-project.org/projects/doctrine-persistence/en/latest/index.html)
* [Downloads](https://github.com/doctrine/persistence/releases)

[Coverage 3.3 image]: https://codecov.io/gh/doctrine/persistence/branch/3.3.x/graph/badge.svg
[CodeCov 3.3]: https://codecov.io/gh/doctrine/persistence/branch/3.3.x
[GA 3.3 image]: https://github.com/doctrine/persistence/workflows/Continuous%20Integration/badge.svg?branch=3.3.x
[GA 3.3]: https://github.com/doctrine/persistence/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A3.3.x
8 changes: 5 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ awareness about deprecated code.
- Use of our low-overhead runtime deprecation API, details:
https://github.com/doctrine/deprecations/

# Upgrade to 3.1
# Upgrade to 3.3

## Added method `Proxy::__setInitialized()`
## Added method `ObjectManager::isUninitializedObject()`

Classes implementing `Doctrine\Persistence\Proxy` should implement the new
Classes implementing `Doctrine\Persistence\ObjectManager` should implement the new
method. This method will be added to the interface in 4.0.

# Upgrade to 3.1

## Deprecated `RuntimePublicReflectionProperty`

Use `RuntimeReflectionProperty` instead.
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
"psr/cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"composer/package-versions-deprecated": "^1.11",
"phpstan/phpstan": "1.9.4",
"phpstan/phpstan": "1.11.1",
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan-strict-rules": "^1.1",
"doctrine/coding-standard": "^11",
"doctrine/coding-standard": "^12",
"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
20 changes: 15 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ parameters:
path: src/Persistence/Reflection/EnumReflectionProperty.php

-
message: "#^Call to function method_exists\\(\\) with Doctrine\\\\Persistence\\\\Proxy and '__setInitialized' will always evaluate to true\\.$#"
message: "#^Method Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty\\:\\:getDeclaringClass\\(\\) return type with generic class ReflectionClass does not specify its types\\: T$#"
count: 1
path: src/Persistence/Reflection/RuntimeReflectionProperty.php
path: src/Persistence/Reflection/EnumReflectionProperty.php

-
message: "#^Method Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty\\:\\:toEnum\\(\\) should return array\\<BackedEnum\\>\\|BackedEnum but returns array\\<BackedEnum\\|int\\|string\\>\\.$#"
count: 1
path: src/Persistence/Reflection/EnumReflectionProperty.php

-
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(BackedEnum\\|int\\|string\\)\\: mixed\\)\\|null, array\\{class\\-string\\<BackedEnum\\>, 'from'\\} given\\.$#"
count: 1
path: src/Persistence/Reflection/EnumReflectionProperty.php

-
message: "#^Variable property access on \\$this\\(Doctrine\\\\Persistence\\\\Reflection\\\\TypedNoDefaultRuntimePublicReflectionProperty\\)\\.$#"
Expand All @@ -31,17 +41,17 @@ parameters:
path: tests/Persistence/Mapping/DriverChainTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'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\\:\\: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\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\Bar\\\\\\\\subDirClass', 'Foo\\\\\\\\stdClass'\\} and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
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/Persistence/Mapping/SymfonyFileLocatorTest.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\\.$#"
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/Persistence/Mapping/SymfonyFileLocatorTest.php

Expand Down
29 changes: 21 additions & 8 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,11 +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">
<InvalidArgument>
<code><![CDATA[$name]]></code>
</InvalidArgument>
<InvalidReturnStatement>
<code><![CDATA[$value]]></code>
</InvalidReturnStatement>
<PossiblyInvalidArgument>
<code><![CDATA[$value]]></code>
</PossiblyInvalidArgument>
</file>
</files>
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<psalm
errorLevel="3"
phpVersion="8.1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
findUnusedPsalmSuppress="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
20 changes: 10 additions & 10 deletions src/Persistence/AbstractManagerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function getName()
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getConnection(?string $name = null)
{
Expand All @@ -107,15 +107,15 @@ public function getConnection(?string $name = null)
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getConnectionNames()
{
return $this->connections;
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getConnections()
{
Expand All @@ -128,23 +128,23 @@ public function getConnections()
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getDefaultConnectionName()
{
return $this->defaultConnection;
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getDefaultManagerName()
{
return $this->defaultManager;
}

/**
* {@inheritdoc}
* {@inheritDoc}
*
* @throws InvalidArgumentException
*/
Expand Down Expand Up @@ -195,15 +195,15 @@ public function getManagerForClass(string $class)
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getManagerNames()
{
return $this->managers;
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getManagers()
{
Expand All @@ -218,7 +218,7 @@ public function getManagers()
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getRepository(
string $persistentObject,
Expand All @@ -230,7 +230,7 @@ public function getRepository(
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function resetManager(?string $name = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/Mapping/Driver/FileDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ abstract protected function loadMappingFile(string $file);
protected function initialize()
{
$this->classCache = [];
if ($this->globalBasename === null) {
if ($this->globalBasename === '') {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Persistence/Mapping/Driver/StaticPHPDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function addPaths(array $paths)
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function loadMetadataForClass(string $className, ClassMetadata $metadata)
{
Expand Down Expand Up @@ -123,7 +123,7 @@ public function getAllClassNames()
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function isTransient(string $className)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Persistence/ObjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Contract for a Doctrine persistence layer ObjectManager class to implement.
*
* @method bool isUninitializedObject(mixed $value) Implementing this method will be mandatory in version 4.
*/
interface ObjectManager
{
Expand Down
8 changes: 4 additions & 4 deletions src/Persistence/ObjectManagerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class ObjectManagerDecorator implements ObjectManager
protected $wrapped;

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function find(string $className, $id)
{
Expand Down Expand Up @@ -56,15 +56,15 @@ public function flush()
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getRepository(string $className)
{
return $this->wrapped->getRepository($className);
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getClassMetadata(string $className)
{
Expand All @@ -83,7 +83,7 @@ public function initializeObject(object $obj)
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function contains(object $object)
{
Expand Down
1 change: 0 additions & 1 deletion src/Persistence/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Interface for proxy classes.
*
* @template T of object
* @method void __setInitialized(bool $initialized) Implementing this method will be mandatory in version 4.
*/
interface Proxy
{
Expand Down
Loading

0 comments on commit 46d44c5

Please sign in to comment.