Add missing dots at the end of exception messages
This commit is contained in:
parent
cc8d23a8ce
commit
6dad402e97
@ -32,10 +32,10 @@ class HttpCodeActivationStrategy extends ErrorLevelActivationStrategy
|
|||||||
{
|
{
|
||||||
foreach ($exclusions as $exclusion) {
|
foreach ($exclusions as $exclusion) {
|
||||||
if (!\array_key_exists('code', $exclusion)) {
|
if (!\array_key_exists('code', $exclusion)) {
|
||||||
throw new \LogicException(sprintf('An exclusion must have a "code" key'));
|
throw new \LogicException(sprintf('An exclusion must have a "code" key.'));
|
||||||
}
|
}
|
||||||
if (!\array_key_exists('urls', $exclusion)) {
|
if (!\array_key_exists('urls', $exclusion)) {
|
||||||
throw new \LogicException(sprintf('An exclusion must have a "urls" key'));
|
throw new \LogicException(sprintf('An exclusion must have a "urls" key.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,10 +48,10 @@ class Configuration
|
|||||||
|
|
||||||
foreach ($thresholds as $group => $threshold) {
|
foreach ($thresholds as $group => $threshold) {
|
||||||
if (!\in_array($group, $groups, true)) {
|
if (!\in_array($group, $groups, true)) {
|
||||||
throw new \InvalidArgumentException(sprintf('Unrecognized threshold "%s", expected one of "%s"', $group, implode('", "', $groups)));
|
throw new \InvalidArgumentException(sprintf('Unrecognized threshold "%s", expected one of "%s".', $group, implode('", "', $groups)));
|
||||||
}
|
}
|
||||||
if (!is_numeric($threshold)) {
|
if (!is_numeric($threshold)) {
|
||||||
throw new \InvalidArgumentException(sprintf('Threshold for group "%s" has invalid value "%s"', $group, $threshold));
|
throw new \InvalidArgumentException(sprintf('Threshold for group "%s" has invalid value "%s".', $group, $threshold));
|
||||||
}
|
}
|
||||||
$this->thresholds[$group] = (int) $threshold;
|
$this->thresholds[$group] = (int) $threshold;
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ class Configuration
|
|||||||
parse_str($serializedConfiguration, $normalizedConfiguration);
|
parse_str($serializedConfiguration, $normalizedConfiguration);
|
||||||
foreach (array_keys($normalizedConfiguration) as $key) {
|
foreach (array_keys($normalizedConfiguration) as $key) {
|
||||||
if (!\in_array($key, ['max', 'disabled', 'verbose'], true)) {
|
if (!\in_array($key, ['max', 'disabled', 'verbose'], true)) {
|
||||||
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s"', $key));
|
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s".', $key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class Deprecation
|
|||||||
public function originatingClass()
|
public function originatingClass()
|
||||||
{
|
{
|
||||||
if (null === $this->originClass) {
|
if (null === $this->originClass) {
|
||||||
throw new \LogicException('Check with originatesFromAnObject() before calling this method');
|
throw new \LogicException('Check with originatesFromAnObject() before calling this method.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->originClass;
|
return $this->originClass;
|
||||||
@ -121,7 +121,7 @@ class Deprecation
|
|||||||
public function originatingMethod()
|
public function originatingMethod()
|
||||||
{
|
{
|
||||||
if (null === $this->originMethod) {
|
if (null === $this->originMethod) {
|
||||||
throw new \LogicException('Check with originatesFromAnObject() before calling this method');
|
throw new \LogicException('Check with originatesFromAnObject() before calling this method.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->originMethod;
|
return $this->originMethod;
|
||||||
@ -237,7 +237,7 @@ class Deprecation
|
|||||||
$relativePath = substr($path, \strlen($vendorRoot) + 1);
|
$relativePath = substr($path, \strlen($vendorRoot) + 1);
|
||||||
$vendor = strstr($relativePath, \DIRECTORY_SEPARATOR, true);
|
$vendor = strstr($relativePath, \DIRECTORY_SEPARATOR, true);
|
||||||
if (false === $vendor) {
|
if (false === $vendor) {
|
||||||
throw new \RuntimeException(sprintf('Could not find directory separator "%s" in path "%s"', \DIRECTORY_SEPARATOR, $relativePath));
|
throw new \RuntimeException(sprintf('Could not find directory separator "%s" in path "%s".', \DIRECTORY_SEPARATOR, $relativePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
return rtrim($vendor.'/'.strstr(substr(
|
return rtrim($vendor.'/'.strstr(substr(
|
||||||
@ -247,7 +247,7 @@ class Deprecation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \RuntimeException(sprintf('No vendors found for path "%s"', $path));
|
throw new \RuntimeException(sprintf('No vendors found for path "%s".', $path));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,7 +106,7 @@ EOF
|
|||||||
$filter = $input->getOption('filter');
|
$filter = $input->getOption('filter');
|
||||||
|
|
||||||
if (null !== $name && [] === $this->getFilesystemLoaders()) {
|
if (null !== $name && [] === $this->getFilesystemLoaders()) {
|
||||||
throw new InvalidArgumentException(sprintf('Argument "name" not supported, it requires the Twig loader "%s"', FilesystemLoader::class));
|
throw new InvalidArgumentException(sprintf('Argument "name" not supported, it requires the Twig loader "%s".', FilesystemLoader::class));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($input->getOption('format')) {
|
switch ($input->getOption('format')) {
|
||||||
|
@ -65,7 +65,7 @@ abstract class AbstractController implements ServiceSubscriberInterface
|
|||||||
protected function getParameter(string $name)
|
protected function getParameter(string $name)
|
||||||
{
|
{
|
||||||
if (!$this->container->has('parameter_bag')) {
|
if (!$this->container->has('parameter_bag')) {
|
||||||
throw new ServiceNotFoundException('parameter_bag', null, null, [], sprintf('The "%s::getParameter()" method is missing a parameter bag to work properly. Did you forget to register your controller as a service subscriber? This can be fixed either by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.', static::class));
|
throw new ServiceNotFoundException('parameter_bag.', null, null, [], sprintf('The "%s::getParameter()" method is missing a parameter bag to work properly. Did you forget to register your controller as a service subscriber? This can be fixed either by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.', static::class));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->container->get('parameter_bag')->get($name);
|
return $this->container->get('parameter_bag')->get($name);
|
||||||
|
@ -49,7 +49,7 @@ class ResolveControllerNameSubscriber implements EventSubscriberInterface
|
|||||||
public function __call(string $method, array $args)
|
public function __call(string $method, array $args)
|
||||||
{
|
{
|
||||||
if ('onKernelRequest' !== $method && 'onKernelRequest' !== strtolower($method)) {
|
if ('onKernelRequest' !== $method && 'onKernelRequest' !== strtolower($method)) {
|
||||||
throw new \Error(sprintf('Error: Call to undefined method %s::%s()', static::class, $method));
|
throw new \Error(sprintf('Error: Call to undefined method %s::%s().', static::class, $method));
|
||||||
}
|
}
|
||||||
|
|
||||||
$event = $args[0];
|
$event = $args[0];
|
||||||
|
@ -177,7 +177,7 @@ class SodiumVault extends AbstractVault implements EnvVarLoaderInterface
|
|||||||
private function loadKeys(): void
|
private function loadKeys(): void
|
||||||
{
|
{
|
||||||
if (!\function_exists('sodium_crypto_box_seal')) {
|
if (!\function_exists('sodium_crypto_box_seal')) {
|
||||||
throw new \LogicException('The "sodium" PHP extension is required to deal with secrets. Alternatively, try running "composer require paragonie/sodium_compat" if you cannot enable the extension."');
|
throw new \LogicException('The "sodium" PHP extension is required to deal with secrets. Alternatively, try running "composer require paragonie/sodium_compat" if you cannot enable the extension.".');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $this->encryptionKey || '' !== $this->decryptionKey = (string) $this->decryptionKey) {
|
if (null !== $this->encryptionKey || '' !== $this->decryptionKey = (string) $this->decryptionKey) {
|
||||||
@ -214,7 +214,7 @@ class SodiumVault extends AbstractVault implements EnvVarLoaderInterface
|
|||||||
private function createSecretsDir(): void
|
private function createSecretsDir(): void
|
||||||
{
|
{
|
||||||
if ($this->secretsDir && !is_dir($this->secretsDir) && !@mkdir($this->secretsDir, 0777, true) && !is_dir($this->secretsDir)) {
|
if ($this->secretsDir && !is_dir($this->secretsDir) && !@mkdir($this->secretsDir, 0777, true) && !is_dir($this->secretsDir)) {
|
||||||
throw new \RuntimeException(sprintf('Unable to create the secrets directory (%s)', $this->secretsDir));
|
throw new \RuntimeException(sprintf('Unable to create the secrets directory (%s).', $this->secretsDir));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->secretsDir = null;
|
$this->secretsDir = null;
|
||||||
|
@ -41,7 +41,7 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA
|
|||||||
{
|
{
|
||||||
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace).':';
|
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace).':';
|
||||||
if (null !== $this->maxIdLength && \strlen($namespace) > $this->maxIdLength - 24) {
|
if (null !== $this->maxIdLength && \strlen($namespace) > $this->maxIdLength - 24) {
|
||||||
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, \strlen($namespace), $namespace));
|
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s").', $this->maxIdLength - 24, \strlen($namespace), $namespace));
|
||||||
}
|
}
|
||||||
$this->createCacheItem = \Closure::bind(
|
$this->createCacheItem = \Closure::bind(
|
||||||
static function ($key, $value, $isHit) use ($defaultLifetime) {
|
static function ($key, $value, $isHit) use ($defaultLifetime) {
|
||||||
|
@ -130,7 +130,7 @@ final class CacheItem implements ItemInterface
|
|||||||
throw new InvalidArgumentException('Cache tag length must be greater than zero.');
|
throw new InvalidArgumentException('Cache tag length must be greater than zero.');
|
||||||
}
|
}
|
||||||
if (false !== strpbrk($tag, self::RESERVED_CHARACTERS)) {
|
if (false !== strpbrk($tag, self::RESERVED_CHARACTERS)) {
|
||||||
throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters %s', $tag, self::RESERVED_CHARACTERS));
|
throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters %s.', $tag, self::RESERVED_CHARACTERS));
|
||||||
}
|
}
|
||||||
$this->newMetadata[self::METADATA_TAGS][$tag] = $tag;
|
$this->newMetadata[self::METADATA_TAGS][$tag] = $tag;
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ final class CacheItem implements ItemInterface
|
|||||||
throw new InvalidArgumentException('Cache key length must be greater than zero.');
|
throw new InvalidArgumentException('Cache key length must be greater than zero.');
|
||||||
}
|
}
|
||||||
if (false !== strpbrk($key, self::RESERVED_CHARACTERS)) {
|
if (false !== strpbrk($key, self::RESERVED_CHARACTERS)) {
|
||||||
throw new InvalidArgumentException(sprintf('Cache key "%s" contains reserved characters %s', $key, self::RESERVED_CHARACTERS));
|
throw new InvalidArgumentException(sprintf('Cache key "%s" contains reserved characters %s.', $key, self::RESERVED_CHARACTERS));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $key;
|
return $key;
|
||||||
|
@ -144,7 +144,7 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
|||||||
if ($keys instanceof \Traversable) {
|
if ($keys instanceof \Traversable) {
|
||||||
$keys = iterator_to_array($keys, false);
|
$keys = iterator_to_array($keys, false);
|
||||||
} elseif (!\is_array($keys)) {
|
} elseif (!\is_array($keys)) {
|
||||||
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
|
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given.', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -193,7 +193,7 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
|||||||
{
|
{
|
||||||
$valuesIsArray = \is_array($values);
|
$valuesIsArray = \is_array($values);
|
||||||
if (!$valuesIsArray && !$values instanceof \Traversable) {
|
if (!$valuesIsArray && !$values instanceof \Traversable) {
|
||||||
throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values)));
|
throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given.', \is_object($values) ? \get_class($values) : \gettype($values)));
|
||||||
}
|
}
|
||||||
$items = [];
|
$items = [];
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
|||||||
if ($keys instanceof \Traversable) {
|
if ($keys instanceof \Traversable) {
|
||||||
$keys = iterator_to_array($keys, false);
|
$keys = iterator_to_array($keys, false);
|
||||||
} elseif (!\is_array($keys)) {
|
} elseif (!\is_array($keys)) {
|
||||||
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
|
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given.', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -117,7 +117,7 @@ trait MemcachedTrait
|
|||||||
|
|
||||||
if (isset($query['host'])) {
|
if (isset($query['host'])) {
|
||||||
if (!\is_array($hosts = $query['host'])) {
|
if (!\is_array($hosts = $query['host'])) {
|
||||||
throw new InvalidArgumentException(sprintf('Invalid Memcached DSN: %s', $dsn));
|
throw new InvalidArgumentException(sprintf('Invalid Memcached DSN: %s.', $dsn));
|
||||||
}
|
}
|
||||||
foreach ($hosts as $host => $weight) {
|
foreach ($hosts as $host => $weight) {
|
||||||
if (false === $port = strrpos($host, ':')) {
|
if (false === $port = strrpos($host, ':')) {
|
||||||
|
@ -97,7 +97,7 @@ trait RedisTrait
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!\extension_loaded('redis') && !class_exists(\Predis\Client::class)) {
|
if (!\extension_loaded('redis') && !class_exists(\Predis\Client::class)) {
|
||||||
throw new CacheException(sprintf('Cannot find the "redis" extension nor the "predis/predis" package: %s', $dsn));
|
throw new CacheException(sprintf('Cannot find the "redis" extension nor the "predis/predis" package: %s.', $dsn));
|
||||||
}
|
}
|
||||||
|
|
||||||
$params = preg_replace_callback('#^'.$scheme.':(//)?(?:(?:[^:@]*+:)?([^@]*+)@)?#', function ($m) use (&$auth) {
|
$params = preg_replace_callback('#^'.$scheme.':(//)?(?:(?:[^:@]*+:)?([^@]*+)@)?#', function ($m) use (&$auth) {
|
||||||
@ -119,7 +119,7 @@ trait RedisTrait
|
|||||||
|
|
||||||
if (isset($query['host'])) {
|
if (isset($query['host'])) {
|
||||||
if (!\is_array($hosts = $query['host'])) {
|
if (!\is_array($hosts = $query['host'])) {
|
||||||
throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s', $dsn));
|
throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s.', $dsn));
|
||||||
}
|
}
|
||||||
foreach ($hosts as $host => $parameters) {
|
foreach ($hosts as $host => $parameters) {
|
||||||
if (\is_string($parameters)) {
|
if (\is_string($parameters)) {
|
||||||
@ -151,11 +151,11 @@ trait RedisTrait
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$hosts) {
|
if (!$hosts) {
|
||||||
throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s', $dsn));
|
throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s.', $dsn));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($params['redis_sentinel']) && !class_exists(\Predis\Client::class)) {
|
if (isset($params['redis_sentinel']) && !class_exists(\Predis\Client::class)) {
|
||||||
throw new CacheException(sprintf('Redis Sentinel support requires the "predis/predis" package: %s', $dsn));
|
throw new CacheException(sprintf('Redis Sentinel support requires the "predis/predis" package: %s.', $dsn));
|
||||||
}
|
}
|
||||||
|
|
||||||
$params += $query + $options + self::$defaultConnectionOptions;
|
$params += $query + $options + self::$defaultConnectionOptions;
|
||||||
@ -215,7 +215,7 @@ trait RedisTrait
|
|||||||
try {
|
try {
|
||||||
$redis = new $class($hosts, $params);
|
$redis = new $class($hosts, $params);
|
||||||
} catch (\RedisClusterException $e) {
|
} catch (\RedisClusterException $e) {
|
||||||
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e->getMessage(), $dsn));
|
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s.', $e->getMessage(), $dsn));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 < $params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) {
|
if (0 < $params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) {
|
||||||
@ -230,7 +230,7 @@ trait RedisTrait
|
|||||||
try {
|
try {
|
||||||
$redis = new $class(null, $hosts, $params['timeout'], $params['read_timeout'], (bool) $params['persistent']);
|
$redis = new $class(null, $hosts, $params['timeout'], $params['read_timeout'], (bool) $params['persistent']);
|
||||||
} catch (\RedisClusterException $e) {
|
} catch (\RedisClusterException $e) {
|
||||||
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e->getMessage(), $dsn));
|
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s.', $e->getMessage(), $dsn));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 < $params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) {
|
if (0 < $params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) {
|
||||||
@ -250,7 +250,7 @@ trait RedisTrait
|
|||||||
if ($params['redis_cluster']) {
|
if ($params['redis_cluster']) {
|
||||||
$params['cluster'] = 'redis';
|
$params['cluster'] = 'redis';
|
||||||
if (isset($params['redis_sentinel'])) {
|
if (isset($params['redis_sentinel'])) {
|
||||||
throw new InvalidArgumentException(sprintf('Cannot use both "redis_cluster" and "redis_sentinel" at the same time: %s', $dsn));
|
throw new InvalidArgumentException(sprintf('Cannot use both "redis_cluster" and "redis_sentinel" at the same time: %s.', $dsn));
|
||||||
}
|
}
|
||||||
} elseif (isset($params['redis_sentinel'])) {
|
} elseif (isset($params['redis_sentinel'])) {
|
||||||
$params['replication'] = 'sentinel';
|
$params['replication'] = 'sentinel';
|
||||||
|
@ -48,7 +48,7 @@ abstract class BaseNode implements NodeInterface
|
|||||||
public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR)
|
public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR)
|
||||||
{
|
{
|
||||||
if (false !== strpos($name = (string) $name, $pathSeparator)) {
|
if (false !== strpos($name = (string) $name, $pathSeparator)) {
|
||||||
throw new \InvalidArgumentException('The name must not contain "'.$pathSeparator.'".');
|
throw new \InvalidArgumentException('The name must not contain ".'.$pathSeparator.'".');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
@ -472,7 +472,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false === $this->allowEmptyValue) {
|
if (false === $this->allowEmptyValue) {
|
||||||
throw new InvalidDefinitionException(sprintf('->cannotBeEmpty() is not applicable to concrete nodes at path "%s"', $path));
|
throw new InvalidDefinitionException(sprintf('->cannotBeEmpty() is not applicable to concrete nodes at path "%s".', $path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true === $this->atLeastOne) {
|
if (true === $this->atLeastOne) {
|
||||||
|
@ -599,7 +599,7 @@ class Application implements ResetInterface
|
|||||||
|
|
||||||
$exact = \in_array($namespace, $namespaces, true);
|
$exact = \in_array($namespace, $namespaces, true);
|
||||||
if (\count($namespaces) > 1 && !$exact) {
|
if (\count($namespaces) > 1 && !$exact) {
|
||||||
throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
|
throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $exact ? $namespace : reset($namespaces);
|
return $exact ? $namespace : reset($namespaces);
|
||||||
@ -707,7 +707,7 @@ class Application implements ResetInterface
|
|||||||
if (\count($commands) > 1) {
|
if (\count($commands) > 1) {
|
||||||
$suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs));
|
$suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs));
|
||||||
|
|
||||||
throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s", $name, $suggestions), array_values($commands));
|
throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ class EnvVarProcessor implements EnvVarProcessorInterface
|
|||||||
$parsedEnv = parse_url($env);
|
$parsedEnv = parse_url($env);
|
||||||
|
|
||||||
if (false === $parsedEnv) {
|
if (false === $parsedEnv) {
|
||||||
throw new RuntimeException(sprintf('Invalid URL in env var "%s"', $name));
|
throw new RuntimeException(sprintf('Invalid URL in env var "%s".', $name));
|
||||||
}
|
}
|
||||||
if (!isset($parsedEnv['scheme'], $parsedEnv['host'])) {
|
if (!isset($parsedEnv['scheme'], $parsedEnv['host'])) {
|
||||||
throw new RuntimeException(sprintf('Invalid URL env var "%s": schema and host expected, %s given.', $name, $env));
|
throw new RuntimeException(sprintf('Invalid URL env var "%s": schema and host expected, %s given.', $name, $env));
|
||||||
|
@ -690,7 +690,7 @@ class YamlFileLoader extends FileLoader
|
|||||||
try {
|
try {
|
||||||
$configuration = $this->yamlParser->parseFile($file, Yaml::PARSE_CONSTANT | Yaml::PARSE_CUSTOM_TAGS);
|
$configuration = $this->yamlParser->parseFile($file, Yaml::PARSE_CONSTANT | Yaml::PARSE_CUSTOM_TAGS);
|
||||||
} catch (ParseException $e) {
|
} catch (ParseException $e) {
|
||||||
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: %s', $file, $e->getMessage()), 0, $e);
|
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: %s.', $file, $e->getMessage()), 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->validate($configuration, $file);
|
return $this->validate($configuration, $file);
|
||||||
|
@ -246,14 +246,14 @@ class ErrorHandler
|
|||||||
if (!\is_array($log)) {
|
if (!\is_array($log)) {
|
||||||
$log = [$log];
|
$log = [$log];
|
||||||
} elseif (!\array_key_exists(0, $log)) {
|
} elseif (!\array_key_exists(0, $log)) {
|
||||||
throw new \InvalidArgumentException('No logger provided');
|
throw new \InvalidArgumentException('No logger provided.');
|
||||||
}
|
}
|
||||||
if (null === $log[0]) {
|
if (null === $log[0]) {
|
||||||
$this->loggedErrors &= ~$type;
|
$this->loggedErrors &= ~$type;
|
||||||
} elseif ($log[0] instanceof LoggerInterface) {
|
} elseif ($log[0] instanceof LoggerInterface) {
|
||||||
$this->loggedErrors |= $type;
|
$this->loggedErrors |= $type;
|
||||||
} else {
|
} else {
|
||||||
throw new \InvalidArgumentException('Invalid logger provided');
|
throw new \InvalidArgumentException('Invalid logger provided.');
|
||||||
}
|
}
|
||||||
$this->loggers[$type] = $log + $prev[$type];
|
$this->loggers[$type] = $log + $prev[$type];
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class BooleanToStringTransformer implements DataTransformerInterface
|
|||||||
$this->trueValue = $trueValue;
|
$this->trueValue = $trueValue;
|
||||||
$this->falseValues = $falseValues;
|
$this->falseValues = $falseValues;
|
||||||
if (\in_array($this->trueValue, $this->falseValues, true)) {
|
if (\in_array($this->trueValue, $this->falseValues, true)) {
|
||||||
throw new InvalidArgumentException('The specified "true" value is contained in the false-values');
|
throw new InvalidArgumentException('The specified "true" value is contained in the false-values.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class ResolvedFormType implements ResolvedFormTypeInterface
|
|||||||
try {
|
try {
|
||||||
$options = $this->getOptionsResolver()->resolve($options);
|
$options = $this->getOptionsResolver()->resolve($options);
|
||||||
} catch (ExceptionInterface $e) {
|
} catch (ExceptionInterface $e) {
|
||||||
throw new $e(sprintf('An error has occurred resolving the options of the form "%s": %s', \get_class($this->getInnerType()), $e->getMessage()), $e->getCode(), $e);
|
throw new $e(sprintf('An error has occurred resolving the options of the form "%s": %s.', \get_class($this->getInnerType()), $e->getMessage()), $e->getCode(), $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should be decoupled from the specific option at some point
|
// Should be decoupled from the specific option at some point
|
||||||
|
@ -725,7 +725,7 @@ class Request
|
|||||||
|
|
||||||
if (null === $session) {
|
if (null === $session) {
|
||||||
@trigger_error(sprintf('Calling "%s()" when no session has been set is deprecated since Symfony 4.1 and will throw an exception in 5.0. Use "hasSession()" instead.', __METHOD__), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Calling "%s()" when no session has been set is deprecated since Symfony 4.1 and will throw an exception in 5.0. Use "hasSession()" instead.', __METHOD__), E_USER_DEPRECATED);
|
||||||
// throw new \BadMethodCallException('Session has not been set');
|
// throw new \BadMethodCallException('Session has not been set.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $session;
|
return $session;
|
||||||
|
@ -54,11 +54,11 @@ class RedisSessionHandler extends AbstractSessionHandler
|
|||||||
!$redis instanceof RedisProxy &&
|
!$redis instanceof RedisProxy &&
|
||||||
!$redis instanceof RedisClusterProxy
|
!$redis instanceof RedisClusterProxy
|
||||||
) {
|
) {
|
||||||
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
|
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given.', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {
|
if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {
|
||||||
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
|
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->redis = $redis;
|
$this->redis = $redis;
|
||||||
|
@ -64,7 +64,7 @@ class ContainerControllerResolver extends ControllerResolver
|
|||||||
throw new \InvalidArgumentException(sprintf('Controller "%s" has required constructor arguments and does not exist in the container. Did you forget to define the controller as a service?', $class), 0, $e);
|
throw new \InvalidArgumentException(sprintf('Controller "%s" has required constructor arguments and does not exist in the container. Did you forget to define the controller as a service?', $class), 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \InvalidArgumentException(sprintf('Controller "%s" does neither exist as service nor as class', $class), 0, $e);
|
throw new \InvalidArgumentException(sprintf('Controller "%s" does neither exist as service nor as class.', $class), 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function throwExceptionIfControllerWasRemoved(string $controller, \Throwable $previous)
|
private function throwExceptionIfControllerWasRemoved(string $controller, \Throwable $previous)
|
||||||
|
@ -64,7 +64,7 @@ class ControllerResolver implements ControllerResolverInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!\is_callable($controller)) {
|
if (!\is_callable($controller)) {
|
||||||
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s', $request->getPathInfo(), $this->getControllerError($controller)));
|
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s.', $request->getPathInfo(), $this->getControllerError($controller)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $controller;
|
return $controller;
|
||||||
@ -72,7 +72,7 @@ class ControllerResolver implements ControllerResolverInterface
|
|||||||
|
|
||||||
if (\is_object($controller)) {
|
if (\is_object($controller)) {
|
||||||
if (!\is_callable($controller)) {
|
if (!\is_callable($controller)) {
|
||||||
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s', $request->getPathInfo(), $this->getControllerError($controller)));
|
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s.', $request->getPathInfo(), $this->getControllerError($controller)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $controller;
|
return $controller;
|
||||||
@ -89,7 +89,7 @@ class ControllerResolver implements ControllerResolverInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!\is_callable($callable)) {
|
if (!\is_callable($callable)) {
|
||||||
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s', $request->getPathInfo(), $this->getControllerError($callable)));
|
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s.', $request->getPathInfo(), $this->getControllerError($callable)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $callable;
|
return $callable;
|
||||||
|
@ -165,7 +165,7 @@ class LocaleDataGenerator extends AbstractDataGenerator
|
|||||||
// i.e. in de_AT, "AT" is the region
|
// i.e. in de_AT, "AT" is the region
|
||||||
if ($region = \Locale::getRegion($locale)) {
|
if ($region = \Locale::getRegion($locale)) {
|
||||||
if (ctype_alpha($region) && !RegionDataGenerator::isValidCountryCode($region)) {
|
if (ctype_alpha($region) && !RegionDataGenerator::isValidCountryCode($region)) {
|
||||||
throw new MissingResourceException('Skipping "'.$locale.'" due an invalid country.');
|
throw new MissingResourceException(sprintf('Skipping "%s" due an invalid country.', $locale));
|
||||||
}
|
}
|
||||||
|
|
||||||
$extras[] = str_replace(['(', ')'], ['[', ']'], $reader->readEntry($tempDir.'/region', $displayLocale, ['Countries', $region]));
|
$extras[] = str_replace(['(', ')'], ['[', ']'], $reader->readEntry($tempDir.'/region', $displayLocale, ['Countries', $region]));
|
||||||
|
@ -123,7 +123,7 @@ class Query extends AbstractQuery
|
|||||||
$this->resetPagination();
|
$this->resetPagination();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s".%s', $this->dn, $this->query, implode(',', $this->options['filter']), $ldapError));
|
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s".%s.', $this->dn, $this->query, implode(',', $this->options['filter']), $ldapError));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->results[] = $search;
|
$this->results[] = $search;
|
||||||
|
@ -84,7 +84,7 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($count > 1) {
|
if ($count > 1) {
|
||||||
throw new UsernameNotFoundException('More than one user found');
|
throw new UsernameNotFoundException('More than one user found.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry = $entries[0];
|
$entry = $entries[0];
|
||||||
|
@ -87,7 +87,7 @@ class PdoStore implements StoreInterface
|
|||||||
|
|
||||||
if ($connOrDsn instanceof \PDO) {
|
if ($connOrDsn instanceof \PDO) {
|
||||||
if (\PDO::ERRMODE_EXCEPTION !== $connOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
|
if (\PDO::ERRMODE_EXCEPTION !== $connOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
|
||||||
throw new InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __METHOD__));
|
throw new InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __METHOD__));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->conn = $connOrDsn;
|
$this->conn = $connOrDsn;
|
||||||
|
@ -31,7 +31,7 @@ abstract class AbstractApiTransport extends AbstractHttpTransport
|
|||||||
try {
|
try {
|
||||||
$email = MessageConverter::toEmail($message->getOriginalMessage());
|
$email = MessageConverter::toEmail($message->getOriginalMessage());
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new RuntimeException(sprintf('Unable to send message with the "%s" transport: %s', __CLASS__, $e->getMessage()), 0, $e);
|
throw new RuntimeException(sprintf('Unable to send message with the "%s" transport: %s.', __CLASS__, $e->getMessage()), 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->doSendApi($message, $email, $message->getEnvelope());
|
return $this->doSendApi($message, $email, $message->getEnvelope());
|
||||||
|
@ -37,7 +37,7 @@ class RoutableMessageBus implements MessageBusInterface
|
|||||||
public function dispatch($envelope, array $stamps = []): Envelope
|
public function dispatch($envelope, array $stamps = []): Envelope
|
||||||
{
|
{
|
||||||
if (!$envelope instanceof Envelope) {
|
if (!$envelope instanceof Envelope) {
|
||||||
throw new InvalidArgumentException('Messages passed to RoutableMessageBus::dispatch() must be inside an Envelope');
|
throw new InvalidArgumentException('Messages passed to RoutableMessageBus::dispatch() must be inside an Envelope.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var BusNameStamp|null $busNameStamp */
|
/** @var BusNameStamp|null $busNameStamp */
|
||||||
|
@ -384,7 +384,7 @@ class Connection
|
|||||||
$credentials['password'] = '********';
|
$credentials['password'] = '********';
|
||||||
unset($credentials['delay']);
|
unset($credentials['delay']);
|
||||||
|
|
||||||
throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s)', json_encode($credentials)), 0, $e);
|
throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s).', json_encode($credentials)), 0, $e);
|
||||||
}
|
}
|
||||||
$this->amqpChannel = $this->amqpFactory->createChannel($connection);
|
$this->amqpChannel = $this->amqpFactory->createChannel($connection);
|
||||||
|
|
||||||
|
@ -92,13 +92,13 @@ class Connection
|
|||||||
// check for extra keys in options
|
// check for extra keys in options
|
||||||
$optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS));
|
$optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS));
|
||||||
if (0 < \count($optionsExtraKeys)) {
|
if (0 < \count($optionsExtraKeys)) {
|
||||||
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
|
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s].', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for extra keys in options
|
// check for extra keys in options
|
||||||
$queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS));
|
$queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS));
|
||||||
if (0 < \count($queryExtraKeys)) {
|
if (0 < \count($queryExtraKeys)) {
|
||||||
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
|
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s].', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configuration;
|
return $configuration;
|
||||||
|
@ -56,11 +56,11 @@ class Connection
|
|||||||
$this->connection->setOption(\Redis::OPT_SERIALIZER, $redisOptions['serializer'] ?? \Redis::SERIALIZER_PHP);
|
$this->connection->setOption(\Redis::OPT_SERIALIZER, $redisOptions['serializer'] ?? \Redis::SERIALIZER_PHP);
|
||||||
|
|
||||||
if (isset($connectionCredentials['auth']) && !$this->connection->auth($connectionCredentials['auth'])) {
|
if (isset($connectionCredentials['auth']) && !$this->connection->auth($connectionCredentials['auth'])) {
|
||||||
throw new InvalidArgumentException(sprintf('Redis connection failed: %s', $redis->getLastError()));
|
throw new InvalidArgumentException(sprintf('Redis connection failed: %s.', $redis->getLastError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($dbIndex = $configuration['dbindex'] ?? self::DEFAULT_OPTIONS['dbindex']) && !$this->connection->select($dbIndex)) {
|
if (($dbIndex = $configuration['dbindex'] ?? self::DEFAULT_OPTIONS['dbindex']) && !$this->connection->select($dbIndex)) {
|
||||||
throw new InvalidArgumentException(sprintf('Redis connection failed: %s', $redis->getLastError()));
|
throw new InvalidArgumentException(sprintf('Redis connection failed: %s.', $redis->getLastError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->stream = $configuration['stream'] ?? self::DEFAULT_OPTIONS['stream'];
|
$this->stream = $configuration['stream'] ?? self::DEFAULT_OPTIONS['stream'];
|
||||||
|
@ -57,7 +57,7 @@ class DataPart extends TextPart
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false === $handle = @fopen($path, 'r', false)) {
|
if (false === $handle = @fopen($path, 'r', false)) {
|
||||||
throw new InvalidArgumentException(sprintf('Unable to open path "%s"', $path));
|
throw new InvalidArgumentException(sprintf('Unable to open path "%s".', $path));
|
||||||
}
|
}
|
||||||
$p = new self($handle, $name ?: basename($path), $contentType);
|
$p = new self($handle, $name ?: basename($path), $contentType);
|
||||||
$p->handle = $handle;
|
$p->handle = $handle;
|
||||||
|
@ -541,7 +541,7 @@ class PropertyAccessor implements PropertyAccessorInterface
|
|||||||
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
|
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
|
||||||
$object->{$access[self::ACCESS_NAME]}($value);
|
$object->{$access[self::ACCESS_NAME]}($value);
|
||||||
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
|
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
|
||||||
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s"%s', $property, \get_class($object), isset($access[self::ACCESS_NAME]) ? ': '.$access[self::ACCESS_NAME] : '.'));
|
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s"%s.', $property, \get_class($object), isset($access[self::ACCESS_NAME]) ? ': '.$access[self::ACCESS_NAME] : '.'));
|
||||||
} else {
|
} else {
|
||||||
throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
|
throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,11 @@ abstract class ObjectLoader extends Loader
|
|||||||
$loaderObject = $this->getObject($parts[0]);
|
$loaderObject = $this->getObject($parts[0]);
|
||||||
|
|
||||||
if (!\is_object($loaderObject)) {
|
if (!\is_object($loaderObject)) {
|
||||||
throw new \TypeError(sprintf('%s:getObject() must return an object: %s returned', static::class, \gettype($loaderObject)));
|
throw new \TypeError(sprintf('%s:getObject() must return an object: %s returned.', static::class, \gettype($loaderObject)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\is_callable([$loaderObject, $method])) {
|
if (!\is_callable([$loaderObject, $method])) {
|
||||||
throw new \BadMethodCallException(sprintf('Method "%s" not found on "%s" when importing routing resource "%s"', $method, \get_class($loaderObject), $resource));
|
throw new \BadMethodCallException(sprintf('Method "%s" not found on "%s" when importing routing resource "%s".', $method, \get_class($loaderObject), $resource));
|
||||||
}
|
}
|
||||||
|
|
||||||
$routeCollection = $loaderObject->$method($this);
|
$routeCollection = $loaderObject->$method($this);
|
||||||
@ -69,7 +69,7 @@ abstract class ObjectLoader extends Loader
|
|||||||
if (!$routeCollection instanceof RouteCollection) {
|
if (!$routeCollection instanceof RouteCollection) {
|
||||||
$type = \is_object($routeCollection) ? \get_class($routeCollection) : \gettype($routeCollection);
|
$type = \is_object($routeCollection) ? \get_class($routeCollection) : \gettype($routeCollection);
|
||||||
|
|
||||||
throw new \LogicException(sprintf('The %s::%s method must return a RouteCollection: %s returned', \get_class($loaderObject), $method, $type));
|
throw new \LogicException(sprintf('The %s::%s method must return a RouteCollection: %s returned.', \get_class($loaderObject), $method, $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the object file tracked so that if it changes, the cache rebuilds
|
// make the object file tracked so that if it changes, the cache rebuilds
|
||||||
|
@ -222,12 +222,12 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
|
|||||||
{
|
{
|
||||||
if ($this->classDiscriminatorResolver && $mapping = $this->classDiscriminatorResolver->getMappingForClass($class)) {
|
if ($this->classDiscriminatorResolver && $mapping = $this->classDiscriminatorResolver->getMappingForClass($class)) {
|
||||||
if (!isset($data[$mapping->getTypeProperty()])) {
|
if (!isset($data[$mapping->getTypeProperty()])) {
|
||||||
throw new RuntimeException(sprintf('Type property "%s" not found for the abstract object "%s"', $mapping->getTypeProperty(), $class));
|
throw new RuntimeException(sprintf('Type property "%s" not found for the abstract object "%s".', $mapping->getTypeProperty(), $class));
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = $data[$mapping->getTypeProperty()];
|
$type = $data[$mapping->getTypeProperty()];
|
||||||
if (null === ($mappedClass = $mapping->getClassForType($type))) {
|
if (null === ($mappedClass = $mapping->getClassForType($type))) {
|
||||||
throw new RuntimeException(sprintf('The type "%s" has no mapped class for the abstract object "%s"', $type, $class));
|
throw new RuntimeException(sprintf('The type "%s" has no mapped class for the abstract object "%s".', $type, $class));
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = $mappedClass;
|
$class = $mappedClass;
|
||||||
|
@ -58,7 +58,7 @@ class XliffFileLoader implements LoaderInterface
|
|||||||
|
|
||||||
$xliffVersion = XliffUtils::getVersionNumber($dom);
|
$xliffVersion = XliffUtils::getVersionNumber($dom);
|
||||||
if ($errors = XliffUtils::validateSchema($dom)) {
|
if ($errors = XliffUtils::validateSchema($dom)) {
|
||||||
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $resource, XliffUtils::getErrorsAsString($errors)));
|
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s.', $resource, XliffUtils::getErrorsAsString($errors)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('1.2' === $xliffVersion) {
|
if ('1.2' === $xliffVersion) {
|
||||||
|
@ -41,7 +41,7 @@ class XliffUtils
|
|||||||
$namespace = $xliff->attributes->getNamedItem('xmlns');
|
$namespace = $xliff->attributes->getNamedItem('xmlns');
|
||||||
if ($namespace) {
|
if ($namespace) {
|
||||||
if (0 !== substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34)) {
|
if (0 !== substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34)) {
|
||||||
throw new InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s"', $namespace));
|
throw new InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s".', $namespace));
|
||||||
}
|
}
|
||||||
|
|
||||||
return substr($namespace, 34);
|
return substr($namespace, 34);
|
||||||
|
@ -138,7 +138,7 @@ class BicValidator extends ConstraintValidator
|
|||||||
try {
|
try {
|
||||||
$iban = $this->getPropertyAccessor()->getValue($object, $path);
|
$iban = $this->getPropertyAccessor()->getValue($object, $path);
|
||||||
} catch (NoSuchPropertyException $e) {
|
} catch (NoSuchPropertyException $e) {
|
||||||
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s', $path, \get_class($constraint), $e->getMessage()), 0, $e);
|
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s.', $path, \get_class($constraint), $e->getMessage()), 0, $e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$iban) {
|
if (!$iban) {
|
||||||
|
@ -157,7 +157,7 @@ class RangeValidator extends ConstraintValidator
|
|||||||
try {
|
try {
|
||||||
return $this->getPropertyAccessor()->getValue($object, $propertyPath);
|
return $this->getPropertyAccessor()->getValue($object, $propertyPath);
|
||||||
} catch (NoSuchPropertyException $e) {
|
} catch (NoSuchPropertyException $e) {
|
||||||
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s', $propertyPath, \get_class($constraint), $e->getMessage()), 0, $e);
|
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s.', $propertyPath, \get_class($constraint), $e->getMessage()), 0, $e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ class Exporter
|
|||||||
|
|
||||||
if ($reflector->hasMethod('__serialize')) {
|
if ($reflector->hasMethod('__serialize')) {
|
||||||
if (!$reflector->getMethod('__serialize')->isPublic()) {
|
if (!$reflector->getMethod('__serialize')->isPublic()) {
|
||||||
throw new \Error(sprintf('Call to %s method %s::__serialize()', $reflector->getMethod('__serialize')->isProtected() ? 'protected' : 'private', $class));
|
throw new \Error(sprintf('Call to %s method %s::__serialize().', $reflector->getMethod('__serialize')->isProtected() ? 'protected' : 'private', $class));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\is_array($properties = $value->__serialize())) {
|
if (!\is_array($properties = $value->__serialize())) {
|
||||||
|
@ -164,7 +164,7 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
$client = $this->getHttpClient(__FUNCTION__);
|
$client = $this->getHttpClient(__FUNCTION__);
|
||||||
|
|
||||||
$response = $client->request('GET', 'http://localhost:8057', ['buffer' => function () {
|
$response = $client->request('GET', 'http://localhost:8057', ['buffer' => function () {
|
||||||
throw new \Exception('Boo');
|
throw new \Exception('Boo.');
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
$this->assertSame(200, $response->getStatusCode());
|
$this->assertSame(200, $response->getStatusCode());
|
||||||
@ -646,7 +646,7 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
$response = $client->request('GET', 'http://localhost:8057/timeout-body', [
|
$response = $client->request('GET', 'http://localhost:8057/timeout-body', [
|
||||||
'on_progress' => function ($dlNow) {
|
'on_progress' => function ($dlNow) {
|
||||||
if (0 < $dlNow) {
|
if (0 < $dlNow) {
|
||||||
throw new \Exception('Aborting the request');
|
throw new \Exception('Aborting the request.');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@ -656,7 +656,7 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
}
|
}
|
||||||
$this->fail(ClientExceptionInterface::class.' expected');
|
$this->fail(ClientExceptionInterface::class.' expected');
|
||||||
} catch (TransportExceptionInterface $e) {
|
} catch (TransportExceptionInterface $e) {
|
||||||
$this->assertSame('Aborting the request', $e->getPrevious()->getMessage());
|
$this->assertSame('Aborting the request.', $e->getPrevious()->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertNotNull($response->getInfo('error'));
|
$this->assertNotNull($response->getInfo('error'));
|
||||||
@ -670,7 +670,7 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
$response = $client->request('GET', 'http://localhost:8057/timeout-body', [
|
$response = $client->request('GET', 'http://localhost:8057/timeout-body', [
|
||||||
'on_progress' => function ($dlNow) {
|
'on_progress' => function ($dlNow) {
|
||||||
if (0 < $dlNow) {
|
if (0 < $dlNow) {
|
||||||
throw new \Error('BUG');
|
throw new \Error('BUG.');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@ -680,7 +680,7 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
}
|
}
|
||||||
$this->fail('Error expected');
|
$this->fail('Error expected');
|
||||||
} catch (\Error $e) {
|
} catch (\Error $e) {
|
||||||
$this->assertSame('BUG', $e->getMessage());
|
$this->assertSame('BUG.', $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertNotNull($response->getInfo('error'));
|
$this->assertNotNull($response->getInfo('error'));
|
||||||
|
Reference in New Issue
Block a user