Comments (18)
Handled and tested: preparing release.
from collections.
As noted in #177 (comment), scavenging vendor/
for annotations is not a good idea. This is an issue to be reported in APIPlatform.
from collections.
Well, multiple Symfony component needs to be able to read metadata (potentially using annotations) from arbitrary classes (Validator and Serializer are the one coming to my mind right now).
And at least for these 2 components, it is very common to use them on object graphs involving Doctrine collections (as a common use case is to use them on your entities).
Most of the time, you won't need any metadata there, as you want to treat the collection with the standard handling of Traversable. But this does not mean that Symfony forbids defining a custom behavior, and so it still tries to find the metadata.
The fix for that would be to ignore the Psalm-specific tags in doctrine/annotations by default, as is done already for phpdoc tags.
from collections.
Yeah, currently patching doctrine/annotations
, since -
is not a valid class identifier anyway
from collections.
Please note: you'll need doctrine/collections
1.6.1
along with doctrine/annotations
1.6.1
.
from collections.
hmm, regarding @template
itself, ignoring it might cause issues with the \Sensio\Bundle\FrameworkExtraBundle\Configuration\Template
annotation though, in case the ignore list is case sensitive
from collections.
Can you check if #186 fixes this, or if we still need to ignore these annotations?
from collections.
this won't fix it, as doctrine/annotations will still complain. But it will make it simpler to ignore it by default.
from collections.
Interesting that it parses @psalm
- easier to skip indeed though :)
from collections.
@Ocramius doctrine/annotation will parse everything starting with @
, unless explicitly configured to be ignored. That's how it works, so that it can report mistakes where you forgot to import the annotation.
from collections.
hmm, automatically excluding anything containing a -
indeed solves it pretty nicely.
from collections.
Time to revive https://wiki.php.net/rfc/annotations or https://wiki.php.net/rfc/annotations_v2 ! 😉
from collections.
@trompette this has nothing to do with the current problem.
from collections.
Meanwhile, re-opening here, while working on the issue 👍
from collections.
I've provided doctrine/annotations#257 - give it a shot please :)
from collections.
Still has this error for me when using dev-master using it in a Symfony 4.2 app.
[Semantical Error] The annotation "@psalm" in class Doctrine\Common\Collections\AbstractLazyCollection was never imported. Did you maybe forget to add a "use" statement for this annotation?
from collections.
Using dev-master
, will not help, this is not merged yet. @Ocramius, https://twitter.com/greg0ire/status/1089973726429499392?s=20
from collections.
@jverdeyen it is merged now, but in the 1.6 branch.
from collections.
Related Issues (20)
- Question: `Selectable` return value HOT 5
- instanceof checks in `ExpressionVisitor`
- Use splice instead of unset in ArrayCollection HOT 7
- Adding a ReadableCollection interface HOT 3
- Criteria::expr() can be null - IDE is warning us HOT 1
- Static analysis issue regarding ReadableCollection interface HOT 12
- Unable to resolve the template type TMaybeContained HOT 7
- Feature request: groupBy similar to orderBy Expression
- Feature request: add a `find` method HOT 3
- [2.1.1] Method `ArrayAccess::offsetExists()` might add `bool` as a native return type declaration in the future. HOT 3
- ReadableCollection filter method with phpstan in the context of a Collection instancied as ArrayCollection
- Psalm annotations ArrayCollection->contains() incorrect HOT 2
- Add unique() method HOT 1
- should the return type of ReadableCollection:filter() & ReadableCollection:map() not be static ? HOT 16
- Question: is there any way to reindex a collection using callable function that defines index? HOT 1
- Use looser `callable` type in place of `Closure` HOT 4
- Collection index field ignored when selecting things from a not-initialized extra lazy collection
- Enum `Order` should be correctly handled as an enum HOT 2
- Lets allow collections to be indexed by any \Stringable values
- RemoveElement return type nullable?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collections.