Upgrade to 3.2.0

This commit is contained in:
Bastian Allgeier
2019-06-25 09:56:08 +02:00
parent 9e18cf635d
commit 9c89153d35
296 changed files with 14408 additions and 2504 deletions

View File

@@ -3,19 +3,19 @@
namespace Kirby\Toolkit;
use Exception;
use Kirby\Image\Image;
use Kirby\Toolkit\Str;
use ReflectionFunction;
use Throwable;
/**
* A set of validator methods
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license MIT
*/
* A set of validator methods
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier GmbH
* @license https://opensource.org/licenses/MIT
*/
class V
{
@@ -66,17 +66,20 @@ class V
$reflection = new ReflectionFunction($validator);
$arguments = [];
foreach ($reflection->getParameters() as $index => $parameter) {
$value = $params[$index] ?? null;
if (is_array($value) === true) {
foreach ($value as $index => $item) {
if (is_array($item) === true) {
$value[$index] = implode('|', $item);
try {
foreach ($value as $index => $item) {
if (is_array($item) === true) {
$value[$index] = implode('|', $item);
}
}
$value = implode(', ', $value);
} catch (Throwable $e) {
$value = '-';
}
$value = implode(', ', $value);
}
$arguments[$parameter->getName()] = $value;