Class constants as arguments are not recognised as valid imports
See original GitHub issueSee below. Happy to expand on this if it’s not clear.
<?php
namespace Com\SomeBundle\Observer;
use Com\SomeBundle\Events\SomethingEvents; // this use statement is unrecognised, and e.g. when optimizing imports, this gets removed
use Com\SomeBundle\Event\MySomethingEvent;
use JMS\DiExtraBundle\Annotation as DI;
/**
* @DI\Service
*/
class SomeEventObserver
{
/**
* @DI\Observe(SomethingEvents::PRE_UPDATE)
*/
public function doSomething(MySomethingEvent $event)
{
// whatever
}
}
<?php
namespace Com\SomeBundle\Events;
class SomethingEvents
{
const PRE_UPDATE = 'something.pre_update';
}
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Class is not defined despite being imported - python
py file containing my class, Python is insistent that the class doesn't actually exist. I have a theory that the import is not...
Read more >Python Constants: Improve Your Code's Maintainability
Using named constants to provide default argument values to functions, methods, and classes is another common practice in Python.
Read more >os — Miscellaneous operating system interfaces — Python ...
In Python, file names, command line arguments, and environment variables are represented using the string type. On some systems, decoding these strings to ......
Read more >Export and Import - The Modern JavaScript Tutorial
We can label any declaration as exported by placing export before it, be it a variable, function or a class. For instance, here...
Read more >export - JavaScript - MDN Web Docs
The value of an imported binding is subject to change in the module that exports ... let, // const, function, class) export let...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yeah, @Haehnchen any update on this?
done