-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CachedReader] Test traits and parent class to see if cache is fresh #62
Conversation
This PR probably fixes an issue I've been having with Symfony. Our workflow includes generating the mapping into a separate trait, so it can be regenerated when needed without hitting business functionality. For example: /*
* @ORM\Entity
*/
class MyEntity
{
use Generated\MyEntityTrait;
} And the trait: trait MyEntityTrait
{
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
} Running
While digging into this I ran into this PR which likely fixes it. Any timeline on merging? |
@Ocramius This seems good to go to me. |
Any chance the change can be merged in soonish? Hitting the same problem with bitexpert/disco when using traits to split up the DI config into smaller components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will apply review comments myself while merging.
$lastModification = filemtime($filename); | ||
|
||
// Test traits | ||
if (method_exists($class, 'getTraits')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be moved to a private method
} | ||
|
||
// Test parents | ||
while ($parent = $class->getParentClass()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be moved to a private method
|
||
public function testIgnoresStaleCacheWithTraits() | ||
{ | ||
if (version_compare(PHP_VERSION, '5.4.0') < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support these versions anymore, luckily.
Moved rest of the PR to #96 |
…lass-ttl-in-annotations Fix/#62 check trait and parent class ttl in annotations
This PR is useful if for exemple you work with traits in your entities or with a parent class.
Before, the cache was not refreshed when you made changes in traits or parent class.