Skip to content

Doctrine stubs seems to take precedence over doctrine default classes and causing errors #1950

@JanMikes

Description

@JanMikes

Hello!

I think there is problem with doctrine stubs, etc vendor/rector/rector/stubs/Doctrine/Empty/GeneratedValue.php

It seems that these classes gets autoloaded earlier than doctrine classes so if (class_exists('Doctrine\ORM\Mapping\GeneratedValue')) { condition is false and stub classes are used instead (at least i found it so far that this is happening by xdebugging).

Subject Details
PHP version 7.3
Full Command bin/console

Current Behaviour

Many errors of this type occurs, whenever bin/console is run or any http request:

In AnnotationDriver.php line 326:
                                                                              
  Notice: Undefined property: Doctrine\ORM\Mapping\GeneratedValue::$strategy  
                                                                              

In AnnotationException.php line 54:
                                                                                                                                                                                       
  [Semantical Error] The class "Doctrine\ORM\Mapping\InheritanceType" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to a  
  dd @Annotation to the _class_ doc comment of "Doctrine\ORM\Mapping\InheritanceType". If it is indeed no annotation, then you need to add @IgnoreAnnotation("ORM\InheritanceType") t  
  o the _class_ doc comment of class Spaceflow\Api\BillingProfile\Entity\BillingProfile.   

Minimal PHP Code Causing Issue

I am not able to provide code, but basically any project having Symfony + Doctrine will have this issue on current master branch.

Expected Behaviour

To run smoothly :-).

Metadata

Metadata

Assignees

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