Skip to content

The $reportFieldsWhereDeclared argument is no longer supported, make sure to omit it when calling Doctrine\ORM\Mapping\Driver\AttributeDriver::__construct. #11568

@fabpico

Description

@fabpico

Bug Report

I just want to create migration scripts out of entity classes.
I run php bin/console doctrine:migrations:diff.
I receive this error:

The $reportFieldsWhereDeclared argument is no longer supported, make sure to omit it when calling Doctrine\ORM\Mapping\Driver\AttributeDriver::__construct.

I am not calling Doctrine\ORM\Mapping\Driver\AttributeDriver by my own, this is surely called indirectly within the doctrine code. Pretty sure the packages are not entirely compatible with each other.

I installed the latest packages, resulted to:

    "doctrine/collections": "^2.2",
    "doctrine/doctrine-bundle": "^2.11",
    "doctrine/doctrine-migrations-bundle": "^3.3",
    "doctrine/orm": "^3.0",

Resolves to:

    "doctrine/collections": "2.2.2",
    "doctrine/doctrine-bundle": "2.11.0",
    "doctrine/doctrine-migrations-bundle": "3.3.1",
    "doctrine/orm": "3.0.0",

doctrine.yaml

doctrine:
  dbal:
    url: '%env(resolve:DATABASE_URL)%'
  orm:
    mappings:
      App:
        dir: '%kernel.project_dir%/src/Infrastructure/Entity'
        prefix: App\Infrastructure\Entity

doctrine_migrations.yaml

doctrine_migrations:
  migrations_paths:
    'App\Migrations': '%kernel.project_dir%/src/Migrations'
  em: default

The only existing test entity for now, since its in development:

<?php declare(strict_types=1);

namespace App\Infrastructure\Entity;

use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity()]
#[ORM\Table(name: '`foo`')]
class Foo
{
    #[ORM\Id]
    #[ORM\Column(type: "uuid")]
    private string $id;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions