The method addSubSource() does not seem to exist on object<OAuth2Framework\B...ientRegistrationSource>.
This check looks for calls to methods that do not seem to exist on a given type.
It looks for the method on the type itself as well as in inherited classes or
implemented interfaces.
This is most likely a typographical error or the method has been renamed.
The method addSubSource() does not seem to exist on object<OAuth2Framework\B...ientRegistrationSource>.
This check looks for calls to methods that do not seem to exist on a given type.
It looks for the method on the type itself as well as in inherited classes or
implemented interfaces.
This is most likely a typographical error or the method has been renamed.
Loading history...
31
}
32
33
/**
34
* {@inheritdoc}
35
*/
36
protected function continueLoading(string $path, ContainerBuilder $container, array $config)
37
{
38
foreach ($config as $k => $v) {
39
$container->setParameter($path.'.'.$k, $v);
40
}
41
42
$loader = new PhpConfigFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/endpoint'));
43
$loader->load('client_registration.php');
44
}
45
46
/**
47
* {@inheritdoc}
48
*/
49
public function name(): string
50
{
51
return 'client_registration';
52
}
53
54
/**
55
* {@inheritdoc}
56
*/
57
public function getNodeDefinition(NodeDefinition $node)
It seems like you code against a specific sub-type and not the parent class Symfony\Component\Config...\Builder\NodeDefinition as the method children() does only exist in the following sub-classes of Symfony\Component\Config...\Builder\NodeDefinition: Symfony\Component\Config...der\ArrayNodeDefinition. Maybe you want to instanceof check for one of these explicitly?
Let’s take a look at an example:
abstractclassUser{/** @return string */abstractpublicfunctiongetPassword();}classMyUserextendsUser{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 sub-classes
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.