* * 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; use ArrayAccess; use SimpleXMLElement; /** * Validates if the input is an array or if the input can be used as an array (instance of `ArrayAccess` or `SimpleXMLElement`). * * @author Alexandre Gomes Gaigalas * @author Henrique Moody */ final class ArrayVal extends AbstractRule { /** * {@inheritdoc} */ public function validate($input): bool { return is_array($input) || $input instanceof ArrayAccess || $input instanceof SimpleXMLElement; } }