/** * @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; }
/** * Constructor accepts message string and any number of parameters, which will be used as string replacements for * message string (unless an instance of \Throwable is found, in which case it is passed to parent as previous). * * @param null|string $message * @param mixed ...$params */ public function __construct(string $message = null, ...$params) { parent::__construct($this->compileMessage($message ?: $this->defaultMessage(), $params), null, $this->compileThrown($params)); }
/** * 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); }