Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForInvalidConstructorMethod PHP Method

createForInvalidConstructorMethod() public static method

public static createForInvalidConstructorMethod ( string $method ) : InvalidArgumentException
$method string
return InvalidArgumentException
    public static function createForInvalidConstructorMethod(string $method) : \InvalidArgumentException
    {
        return new \InvalidArgumentException(sprintf('Invalid constructor method "%s".', $method));
    }

Usage Example

 /**
  * @param FixtureInterface $scope
  * @param string           $method
  *
  * @return array The first element is a ServiceReferenceInterface ($caller) and the second a string ($method)
  */
 private function getCallerReference(FixtureInterface $scope, string $method) : array
 {
     if (false === strpos($method, '::')) {
         return [new StaticReference($scope->getClassName()), $method];
     }
     $explodedMethod = explode('::', $method);
     if (2 < count($explodedMethod)) {
         throw InvalidArgumentExceptionFactory::createForInvalidConstructorMethod($method);
     }
     list($caller, $method) = $explodedMethod;
     if (0 === strpos($caller, '@')) {
         return [new InstantiatedReference(substr($caller, 1)), $method];
     }
     return [new StaticReference($caller), $method];
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForInvalidConstructorMethod