It seems like you code against a concrete implementation and not the interface Doctrine\Persistence\ObjectRepository as the method countByReference() does only exist in the following implementations of said interface: Kunstmaan\VotingBundle\R...\AbstractVoteRepository, Kunstmaan\VotingBundle\R...\FacebookLikeRepository, Kunstmaan\VotingBundle\R...\FacebookSendRepository, Kunstmaan\VotingBundle\R...LinkedInShareRepository, Kunstmaan\VotingBundle\R...Down\DownVoteRepository, Kunstmaan\VotingBundle\R...UpDown\UpVoteRepository.
Let’s take a look at an example:
interfaceUser{/** @return string */publicfunctiongetPassword();}classMyUserimplementsUser{publicfunctiongetPassword(){// return something}publicfunctiongetDisplayName(){// return some name.}}classAuthSystem{publicfunctionauthenticate(User$user){$this->logger->info(sprintf('Authenticating %s.',$user->getDisplayName()));// do something.}}
In the above example, the authenticate() method works fine as long as you just pass
instances of MyUser. However, if you now also want to pass a different implementation
of User which does not have a getDisplayName() method, the code will break.
classAuthSystem{publicfunctionauthenticate(User$user){if($userinstanceofMyUser){$this->logger->info(/** ... */);}// or alternativelyif(!$userinstanceofMyUser){thrownew\LogicException('$user must be an instance of MyUser, '.'other instances are not supported.');}}}
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
It seems like you code against a concrete implementation and not the interface Doctrine\Persistence\ObjectRepository as the method getValueByReference() does only exist in the following implementations of said interface: Kunstmaan\VotingBundle\R...\AbstractVoteRepository, Kunstmaan\VotingBundle\R...\FacebookLikeRepository, Kunstmaan\VotingBundle\R...\FacebookSendRepository, Kunstmaan\VotingBundle\R...LinkedInShareRepository, Kunstmaan\VotingBundle\R...Down\DownVoteRepository, Kunstmaan\VotingBundle\R...UpDown\UpVoteRepository.
Let’s take a look at an example:
interfaceUser{/** @return string */publicfunctiongetPassword();}classMyUserimplementsUser{publicfunctiongetPassword(){// return something}publicfunctiongetDisplayName(){// return some name.}}classAuthSystem{publicfunctionauthenticate(User$user){$this->logger->info(sprintf('Authenticating %s.',$user->getDisplayName()));// do something.}}
In the above example, the authenticate() method works fine as long as you just pass
instances of MyUser. However, if you now also want to pass a different implementation
of User which does not have a getDisplayName() method, the code will break.
classAuthSystem{publicfunctionauthenticate(User$user){if($userinstanceofMyUser){$this->logger->info(/** ... */);}// or alternativelyif(!$userinstanceofMyUser){thrownew\LogicException('$user must be an instance of MyUser, '.'other instances are not supported.');}}}
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.