respect-validation/library/Rules/Call.php

28 lines
586 B
PHP
Raw Normal View History

<?php
2015-06-08 16:47:14 +02:00
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Respect\Validation\Rules;
class Call extends AbstractRelated
{
public function getReferenceValue($input)
{
2015-10-18 03:44:47 +02:00
return call_user_func_array($this->reference, [&$input]);
}
public function hasReference($input): bool
{
return is_callable($this->reference);
}
}