/** * @param string $fqcn */ public function __construct($fqcn) { if (substr($fqcn, 0, 1) !== '\\') { $fqcn = '\\' . $fqcn; } if (!class_exists($fqcn)) { throw InvalidArgumentException::create('Cannot create bundle instance definition for (%s): class does not exist.', $fqcn); } $this->fqcn = $fqcn; }
/** * Performs validations on request prior to calling it. * * @param string|null $method An available global function or object method name * @param string|object|null $object An object class name * @param bool|null $static Whether this is a static call or not * * @throws InvalidArgumentException * * @return array|string */ private static function validateCall($method = null, $object = null, $static = null) { if (null === $method && null === $object && null === $static) { throw InvalidArgumentException::create()->setMessage('Could not validate call (got method "%s", object "%s", static "%s").', var_export($method, true), var_export($object, true), var_export($static, true)); } if (null !== $method && null === $object && null === $static) { return static::validateFunction($method); } return static::validateMethod($method, static::validateClass($object, $static), $static); }