Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface::has PHP Méthode

has() public méthode

Returns true if a parameter name is defined.
public has ( string $name ) : boolean
$name string The parameter name
Résultat boolean true if the parameter name is defined, false otherwise
    function has($name);

Usage Example

 function it_gets_credentials(Request $request, ParameterBagInterface $headersBag)
 {
     $headersBag->has('Authorization')->shouldBeCalled()->willReturn(true);
     $headersBag->get('Authorization')->shouldBeCalled()->willReturn('Bearer bearer-token');
     $request->headers = $headersBag;
     $this->getCredentials($request)->shouldReturn('bearer-token');
 }
All Usage Examples Of Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface::has