PS detects the class, but not its properties

I have a method that type hints a known class, and inside that method the properties of that class are marked as not found:


use App\Resource;
class Cache {
  function timesets(Resource $resource) {
    $this->set('timesets_' . $resource->club_id);


 * @property int $club_id
class ActiveRecord {



class Resource extends ActiveRecord {
  function copy($name) {



Inside Cache::timesets() PS knows that $resource is a App\Resource. But it doesn't know that $resource has a $club_id property or copy() method.

What also doesn't work:

* Adding the @property to Resource
* Adding a @param to Cache::timesets
* Adding a @var inside Cache::timesets

What's the problem? Clicking on Resource opens the right class. Hovering over $resource shows `Resource $resource : Resource`. Where does it go wrong? It does work for other classes here, and for Resource in other places.

Edit 1:

In other places, where Resource does work, the tooltip shows `$resource : App\Resource` so I guess it doesn't really detect the class in Cache::timesets()... A valid type hint should be enough, no?

Edit 2:

It looks like Resource is special... Maybe a reserved word or something? Both Club and Resource are imported, and valid classes, but only Club works... Resource only works indirectly, not as a type hint. Why??


Sooo how do we fix this? Seems like a pretty significant bug. Can I tell PS to forget about primitives? Or make it case sensitive? Anything? says something about 'removing fake classes'. Is that a thing? How?


This bug isn't fixed yet. Did you try typehinting it using this workaround: or


> says something about 'removing fake classes'. Is that a thing? How?

That's a developer's clarification comment, not an advise/workaround.


Please sign in to leave a comment.