Skip to content

Commit

Permalink
Merge branch '2.14.x' into 3.0.x
Browse files Browse the repository at this point in the history
* 2.14.x:
  Deprecate the Annotation interface (doctrine#10178)
  Bump CI to PHP 8.2 and latest database versions (doctrine#10180)
  Remove reference to deprecated DriverChain from docs (doctrine#10179)
  • Loading branch information
derrabus committed Oct 31, 2022
2 parents 4be38e2 + 75340b6 commit 3865835
Show file tree
Hide file tree
Showing 49 changed files with 84 additions and 74 deletions.
43 changes: 14 additions & 29 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -40,14 +40,14 @@ jobs:
extension:
- "pdo_sqlite"
include:
- php-version: "8.1"
- php-version: "8.2"
dbal-version: "3@dev"
extension: "pdo_sqlite"
- php-version: "8.1"
dbal-version: "4@dev"
extension: "pdo_sqlite"
- php-version: "8.1"
dbal-version: "3@dev"
- php-version: "8.2"
dbal-version: "default"
extension: "sqlite3"

steps:
Expand Down Expand Up @@ -98,19 +98,19 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
dbal-version:
- "default"
- "3@dev"
postgres-version:
- "9.6"
- "14"
- "15"
include:
- php-version: "8.1"
- php-version: "8.2"
dbal-version: "4@dev"
postgres-version: "14"
- php-version: "8.2"
dbal-version: "3@dev"
postgres-version: "14"
dbal-version: "default"
postgres-version: "9.6"

services:
postgres:
Expand Down Expand Up @@ -164,24 +164,16 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
dbal-version:
- "default"
- "3@dev"
- "4@dev"
mariadb-version:
- "10.6"
- "10.9"
extension:
- "mysqli"
- "pdo_mysql"
include:
- php-version: "8.2"
dbal-version: "3@dev"
mariadb-version: "10.6"
extension: "pdo_mysql"
- php-version: "8.2"
dbal-version: "3@dev"
mariadb-version: "10.6"
extension: "mysqli"

services:
mariadb:
Expand Down Expand Up @@ -237,9 +229,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
dbal-version:
- "default"
- "3@dev"
mysql-version:
- "5.7"
- "8.0"
Expand All @@ -255,14 +248,6 @@ jobs:
dbal-version: "4@dev"
mysql-version: "8.0"
extension: "pdo_mysql"
- php-version: "8.2"
dbal-version: "3@dev"
mysql-version: "8.0"
extension: "mysqli"
- php-version: "8.2"
dbal-version: "3@dev"
mysql-version: "8.0"
extension: "pdo_mysql"

services:
mysql:
Expand Down
4 changes: 4 additions & 0 deletions UPGRADE.md
Expand Up @@ -525,6 +525,10 @@ As a consequence, the following methods are deprecated:
- `ORMSetup::createAnnotationMetadataConfiguration`
- `ORMSetup::createDefaultAnnotationDriver`

The marker interface `Doctrine\ORM\Mapping\Annotation` is deprecated as well.
All annotation/attribute classes implement
`Doctrine\ORM\Mapping\MappingAttribute` now.

## Deprecated `Doctrine\ORM\Proxy\Proxy` interface.

Use `Doctrine\Persistence\Proxy` instead to check whether proxies are initialized.
Expand Down
6 changes: 3 additions & 3 deletions docs/en/reference/advanced-configuration.rst
Expand Up @@ -399,15 +399,15 @@ Multiple Metadata Sources

When using different components using Doctrine ORM you may end up
with them using two different metadata drivers, for example XML and
PHP. You can use the DriverChain Metadata implementations to
PHP. You can use the MappingDriverChain Metadata implementations to
aggregate these drivers based on namespaces:

.. code-block:: php
<?php
use Doctrine\ORM\Mapping\Driver\DriverChain;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
$chain = new DriverChain();
$chain = new MappingDriverChain();
$chain->addDriver($xmlDriver, 'Doctrine\Tests\Models\Company');
$chain->addDriver($phpDriver, 'Doctrine\Tests\ORM\Mapping');
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/ORM/Mapping/Annotation.php
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Mapping;

/** @deprecated Use {@see MappingAttribute} instead. */
interface Annotation
{
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/AssociationOverride.php
Expand Up @@ -11,7 +11,7 @@
* @NamedArgumentConstructor
* @Target("ANNOTATION")
*/
final class AssociationOverride implements Annotation
final class AssociationOverride implements MappingAttribute
{
/**
* The join column that is being mapped to the persistent attribute.
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/AssociationOverrides.php
Expand Up @@ -17,7 +17,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class AssociationOverrides implements Annotation
final class AssociationOverrides implements MappingAttribute
{
/**
* Mapping overrides of relationship properties.
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/AttributeOverride.php
Expand Up @@ -11,7 +11,7 @@
* @NamedArgumentConstructor
* @Target("ANNOTATION")
*/
final class AttributeOverride implements Annotation
final class AttributeOverride implements MappingAttribute
{
public function __construct(
public string $name,
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/AttributeOverrides.php
Expand Up @@ -17,7 +17,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class AttributeOverrides implements Annotation
final class AttributeOverrides implements MappingAttribute
{
/**
* One or more field or property mapping overrides.
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Cache.php
Expand Up @@ -15,7 +15,7 @@
* @Target({"CLASS","PROPERTY"})
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY)]
final class Cache implements Annotation
final class Cache implements MappingAttribute
{
/** @psalm-param 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' $usage */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php
Expand Up @@ -13,7 +13,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class ChangeTrackingPolicy implements Annotation
final class ChangeTrackingPolicy implements MappingAttribute
{
/** @psalm-param 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT'|'NOTIFY' $value */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Column.php
Expand Up @@ -14,7 +14,7 @@
* @Target({"PROPERTY","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class Column implements Annotation
final class Column implements MappingAttribute
{
/**
* @param int|null $precision The precision for a decimal (exact numeric) column (Applies only for decimal column).
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/CustomIdGenerator.php
Expand Up @@ -13,7 +13,7 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class CustomIdGenerator implements Annotation
final class CustomIdGenerator implements MappingAttribute
{
public function __construct(
public readonly string|null $class = null,
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php
Expand Up @@ -13,7 +13,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class DiscriminatorColumn implements Annotation
final class DiscriminatorColumn implements MappingAttribute
{
public function __construct(
public readonly string|null $name = null,
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/DiscriminatorMap.php
Expand Up @@ -13,7 +13,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class DiscriminatorMap implements Annotation
final class DiscriminatorMap implements MappingAttribute
{
/** @param array<int|string, string> $value */
public function __construct(
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);

require_once __DIR__ . '/../Annotation.php';
require_once __DIR__ . '/../MappingAttribute.php';
require_once __DIR__ . '/../Entity.php';
require_once __DIR__ . '/../Embeddable.php';
require_once __DIR__ . '/../Embedded.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Embeddable.php
Expand Up @@ -11,6 +11,6 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class Embeddable implements Annotation
final class Embeddable implements MappingAttribute
{
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Embedded.php
Expand Up @@ -13,7 +13,7 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class Embedded implements Annotation
final class Embedded implements MappingAttribute
{
public function __construct(
public readonly string|null $class = null,
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Entity.php
Expand Up @@ -15,7 +15,7 @@
* @template T of object
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class Entity implements Annotation
final class Entity implements MappingAttribute
{
/** @psalm-param class-string<EntityRepository<T>>|null $repositoryClass */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/EntityListeners.php
Expand Up @@ -16,7 +16,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class EntityListeners implements Annotation
final class EntityListeners implements MappingAttribute
{
/** @param array<string> $value */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/GeneratedValue.php
Expand Up @@ -13,7 +13,7 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class GeneratedValue implements Annotation
final class GeneratedValue implements MappingAttribute
{
/** @psalm-param 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' $strategy */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php
Expand Up @@ -11,6 +11,6 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class HasLifecycleCallbacks implements Annotation
final class HasLifecycleCallbacks implements MappingAttribute
{
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Id.php
Expand Up @@ -11,6 +11,6 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class Id implements Annotation
final class Id implements MappingAttribute
{
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Index.php
Expand Up @@ -13,7 +13,7 @@
* @Target("ANNOTATION")
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
final class Index implements Annotation
final class Index implements MappingAttribute
{
/**
* @param array<string>|null $columns
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/InheritanceType.php
Expand Up @@ -13,7 +13,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class InheritanceType implements Annotation
final class InheritanceType implements MappingAttribute
{
/** @psalm-param 'NONE'|'JOINED'|'SINGLE_TABLE'|'TABLE_PER_CLASS' $value */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/InverseJoinColumn.php
Expand Up @@ -8,7 +8,7 @@
use Attribute;

#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class InverseJoinColumn implements Annotation
final class InverseJoinColumn implements MappingAttribute
{
use JoinColumnProperties;
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/JoinColumn.php
Expand Up @@ -13,7 +13,7 @@
* @Target({"PROPERTY","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class JoinColumn implements Annotation
final class JoinColumn implements MappingAttribute
{
use JoinColumnProperties;
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/JoinColumns.php
Expand Up @@ -9,7 +9,7 @@
* @NamedArgumentConstructor
* @Target("PROPERTY")
*/
final class JoinColumns implements Annotation
final class JoinColumns implements MappingAttribute
{
/** @param array<JoinColumn> $value */
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/JoinTable.php
Expand Up @@ -13,7 +13,7 @@
* @Target({"PROPERTY","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class JoinTable implements Annotation
final class JoinTable implements MappingAttribute
{
/** @var array<JoinColumn> */
public readonly array $joinColumns;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/ManyToMany.php
Expand Up @@ -13,7 +13,7 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class ManyToMany implements Annotation
final class ManyToMany implements MappingAttribute
{
/**
* @param class-string $targetEntity
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/ManyToOne.php
Expand Up @@ -13,7 +13,7 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class ManyToOne implements Annotation
final class ManyToOne implements MappingAttribute
{
/**
* @param class-string|null $targetEntity
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/MappedSuperclass.php
Expand Up @@ -14,7 +14,7 @@
* @Target("CLASS")
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class MappedSuperclass implements Annotation
final class MappedSuperclass implements MappingAttribute
{
/** @psalm-param class-string<EntityRepository>|null $repositoryClass */
public function __construct(
Expand Down
10 changes: 10 additions & 0 deletions lib/Doctrine/ORM/Mapping/MappingAttribute.php
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Doctrine\ORM\Mapping;

/** A marker interface for mapping attributes. */
interface MappingAttribute extends Annotation
{
}
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/OneToMany.php
Expand Up @@ -13,7 +13,7 @@
* @Target("PROPERTY")
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class OneToMany implements Annotation
final class OneToMany implements MappingAttribute
{
/**
* @param class-string|null $targetEntity
Expand Down

0 comments on commit 3865835

Please sign in to comment.