You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generate:entities command uses the DisconnectedClassMetadataFactory and so getReflectionClass isn't guaranteed to return anything and can be null, as such the following lines in LaravelDoctrine\ACL\Mappings\Subscribers\MappedEventSubscriber should be changed:
From:
/**
* A MappedSuperClass or Abstract class cannot be instantiated.
*
* @param ClassMetadata $metadata
*
* @return bool
*/
protected function isInstantiable(ClassMetadata $metadata)
{
if ($metadata->isMappedSuperclass) {
return false;
}
if ($metadata->getReflectionClass()->isAbstract()) {
return false;
}
return true;
}
To:
/**
* A MappedSuperClass or Abstract class cannot be instantiated.
*
* @param ClassMetadata $metadata
*
* @return bool
*/
protected function isInstantiable(ClassMetadata $metadata)
{
if ($metadata->isMappedSuperclass) {
return false;
}
if (!$metadata->getReflectionClass() || $metadata->getReflectionClass()->isAbstract()) {
return false;
}
return true;
}
I've tried it and it seems to work fine after that - but I don't know if this will affect anything else internally.
The text was updated successfully, but these errors were encountered:
Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].
Package version, Laravel version
1.2
5.3
Expected behaviour
Generates entities
Actual behaviour
Throws up the error in title
Steps to reproduce the behaviour
run php artisan doctrine:generate:entities
This seems to be related to the following issue filed on the doctrine github:
doctrine/orm#4459
and the following pull request:
doctrine/orm#1345
The generate:entities command uses the
DisconnectedClassMetadataFactory
and sogetReflectionClass
isn't guaranteed to return anything and can be null, as such the following lines inLaravelDoctrine\ACL\Mappings\Subscribers\MappedEventSubscriber
should be changed:From:
To:
I've tried it and it seems to work fine after that - but I don't know if this will affect anything else internally.
The text was updated successfully, but these errors were encountered: