Update 1.13.1 Argument #3 ($cascade) must be of type ?array, string given #6765

Closed
opened 2026-01-22 15:38:15 +01:00 by admin · 2 comments
Owner

Originally created by @lebadapetru on GitHub (Jun 19, 2021).

After a composer update which updated the doctrine/annotations package to 1.13.1 i received the following error:

TypeError {#2023
  #message: "Doctrine\ORM\Mapping\OneToMany::__construct(): Argument doctrine/annotations#3 ($cascade) must be of type ?array, string given, called in /var/www/erp/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php on line 944"
  #code: 0
  #file: "./vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php"
  #line: 60
  trace: {
    ./vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php:60 { …}
    ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:944 { …}
    ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:719 { …}
    ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:376 { …}
    ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:178 { …}
    ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php:155 { …}
    ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php:88 { …}
    ./vendor/api-platform/core/src/Util/AnnotationFilterExtractorTrait.php:47 { …}
    ./vendor/api-platform/core/src/Util/AnnotationFilterExtractorTrait.php:112 { …}
    ./vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPass.php:65 { …}
    ./vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPass.php:52 { …}
    ./vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …}
    ./vendor/symfony/dependency-injection/ContainerBuilder.php:736 { …}
    ./vendor/symfony/http-kernel/Kernel.php:541 { …}
    ./vendor/symfony/http-kernel/Kernel.php:780 { …}
    ./vendor/symfony/http-kernel/Kernel.php:121 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
    ./vendor/symfony/console/Application.php:166 { …}
    ./bin/console:43 {
      › $application = new Application($kernel);
      › $application->run($input);
      › 
    }
  }
}

Originally created by @lebadapetru on GitHub (Jun 19, 2021). After a `composer update` which updated the doctrine/annotations package to 1.13.1 i received the following error: ``` TypeError {#2023 #message: "Doctrine\ORM\Mapping\OneToMany::__construct(): Argument doctrine/annotations#3 ($cascade) must be of type ?array, string given, called in /var/www/erp/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php on line 944" #code: 0 #file: "./vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php" #line: 60 trace: { ./vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php:60 { …} ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:944 { …} ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:719 { …} ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:376 { …} ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:178 { …} ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php:155 { …} ./vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php:88 { …} ./vendor/api-platform/core/src/Util/AnnotationFilterExtractorTrait.php:47 { …} ./vendor/api-platform/core/src/Util/AnnotationFilterExtractorTrait.php:112 { …} ./vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPass.php:65 { …} ./vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPass.php:52 { …} ./vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …} ./vendor/symfony/dependency-injection/ContainerBuilder.php:736 { …} ./vendor/symfony/http-kernel/Kernel.php:541 { …} ./vendor/symfony/http-kernel/Kernel.php:780 { …} ./vendor/symfony/http-kernel/Kernel.php:121 { …} ./vendor/symfony/framework-bundle/Console/Application.php:168 { …} ./vendor/symfony/framework-bundle/Console/Application.php:74 { …} ./vendor/symfony/console/Application.php:166 { …} ./bin/console:43 { › $application = new Application($kernel); › $application->run($input); › } } } ```
admin closed this issue 2026-01-22 15:38:15 +01:00
Author
Owner

@greg0ire commented on GitHub (Jun 19, 2021):

The error emanates from a class defined in the ORM. Transferring.

@greg0ire commented on GitHub (Jun 19, 2021): The error emanates from a class defined in the ORM. Transferring.
Author
Owner

@greg0ire commented on GitHub (Jun 19, 2021):

Duplicate of #8720

@greg0ire commented on GitHub (Jun 19, 2021): Duplicate of #8720
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6765