for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Definitions\Helpers;
use Yiisoft\Definitions\Exception\InvalidConfigException;
/**
* @internal
*/
final class ExceptionHelper
{
public static function invalidArrayDefinitionKey(int|string $key): InvalidConfigException
return new InvalidConfigException(
sprintf(
'Invalid definition: invalid key in array definition. Only string keys are allowed, got %d.',
$key,
),
);
}
public static function incorrectArrayDefinitionConstructorArguments(mixed $value): InvalidConfigException
'Invalid definition: incorrect constructor arguments. Expected array, got %s.',
get_debug_type($value)
)
public static function incorrectArrayDefinitionMethodArguments(string $key, mixed $value): InvalidConfigException
'Invalid definition: incorrect method "%s" arguments. Expected array, got "%s". ' .
'Probably you should wrap them into square brackets.',
get_debug_type($value),