Skip to content

Commit

Permalink
make parser work for missing GeneratedValue and InheritanceType
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 30, 2019
1 parent 1cc8592 commit 5618095
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ public function create(): AnnotationReader
{
AnnotationRegistry::registerLoader('class_exists');

return new AnnotationReader();
$annotationReader = new AnnotationReader();

// without this the reader will try to resolve them and fails with an exception
// don't forget to add it to "stubs/Doctrine/Empty" directory, because the class needs to exists
// and run "composer dump-autoload", because the directory is loaded by classmap
$annotationReader::addGlobalIgnoredName('ORM\GeneratedValue');
$annotationReader::addGlobalIgnoredName('ORM\InheritanceType');

return $annotationReader;
}
}
12 changes: 12 additions & 0 deletions stubs/Doctrine/Empty/GeneratedValue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Doctrine\ORM\Mapping;

if (class_exists('Doctrine\ORM\Mapping\GeneratedValue')) {
return;
}

class GeneratedValue
{

}
12 changes: 12 additions & 0 deletions stubs/Doctrine/Empty/InheritanceType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Doctrine\ORM\Mapping;

if (class_exists('Doctrine\ORM\Mapping\InheritanceType')) {
return;
}

class InheritanceType
{

}

0 comments on commit 5618095

Please sign in to comment.