It seems like you code against a concrete implementation and not the interface Kunstmaan\AdminListBundl...stConfiguratorInterface as the method bindRequest() does only exist in the following implementations of said interface: Kunstmaan\AdminBundle\Ad...onAdminListConfigurator, Kunstmaan\AdminListBundl...ctAdminListConfigurator, Kunstmaan\AdminListBundl...ALAdminListConfigurator, Kunstmaan\AdminListBundl...RMAdminListConfigurator, Kunstmaan\AdminListBundl...geAdminListConfigurator, Kunstmaan\ArticleBundle\...orAdminListConfigurator, Kunstmaan\ArticleBundle\...ryAdminListConfigurator, Kunstmaan\ArticleBundle\...geAdminListConfigurator, Kunstmaan\ArticleBundle\...agAdminListConfigurator, Kunstmaan\ArticleBundle\...\AdminList\Configurator, Kunstmaan\FormBundle\Adm...geAdminListConfigurator, Kunstmaan\FormBundle\Adm...onAdminListConfigurator, Kunstmaan\LeadGeneration...upAdminListConfigurator, Kunstmaan\LeadGeneration...esAdminListConfigurator, Kunstmaan\MediaBundle\Ad...iaAdminListConfigurator, Kunstmaan\MenuBundle\Adm...nuAdminListConfigurator, Kunstmaan\MenuBundle\Adm...emAdminListConfigurator, Kunstmaan\NodeBundle\Adm...deAdminListConfigurator, Kunstmaan\RedirectBundle...ctAdminListConfigurator, Kunstmaan\TaggingBundle\...agAdminListConfigurator, Kunstmaan\TranslatorBund...onAdminListConfigurator, Kunstmaan\UserManagement...gsAdminListConfigurator, Kunstmaan\UserManagement...upAdminListConfigurator, Kunstmaan\UserManagement...leAdminListConfigurator, Kunstmaan\UserManagement...erAdminListConfigurator.
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.
Let’s take a look at an example:
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.
Available Fixes
Change the type-hint for the parameter:
Add an additional type-check:
Add the method to the interface: