dependencies-upgrade
This commit is contained in:
@@ -1,25 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Collision.
|
||||
*
|
||||
* (c) Nuno Maduro <enunomaduro@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace NunoMaduro\Collision;
|
||||
|
||||
use NunoMaduro\Collision\Contracts\ArgumentFormatter as ArgumentFormatterContract;
|
||||
|
||||
/**
|
||||
* This is an Collision Argument Formatter implementation.
|
||||
* @internal
|
||||
*
|
||||
* @author Nuno Maduro <enunomaduro@gmail.com>
|
||||
* @see \Tests\Unit\ArgumentFormatterTest
|
||||
*/
|
||||
class ArgumentFormatter implements ArgumentFormatterContract
|
||||
final class ArgumentFormatter implements ArgumentFormatterContract
|
||||
{
|
||||
private const MAX_STRING_LENGTH = 1000;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -30,7 +25,7 @@ class ArgumentFormatter implements ArgumentFormatterContract
|
||||
foreach ($arguments as $argument) {
|
||||
switch (true) {
|
||||
case is_string($argument):
|
||||
$result[] = '"' . $argument . '"';
|
||||
$result[] = '"' . (mb_strlen($argument) > self::MAX_STRING_LENGTH ? mb_substr($argument, 0, self::MAX_STRING_LENGTH) . '...' : $argument) . '"';
|
||||
break;
|
||||
case is_array($argument):
|
||||
$associative = array_keys($argument) !== range(0, count($argument) - 1);
|
||||
|
||||
Reference in New Issue
Block a user