src/Charcoal/Admin/Action/Filesystem/LoadAction.php
protected function assertValidPath($path)
    {
        $translator = $this->translator();

        if (empty($path) && !is_numeric($path)) {
            $message = $translator->translate(
                '{{ parameter }} required and must be a {{ expectedType }}',
                [
                    '{{ parameter }}'    => '"path"',
                    '{{ expectedType }}' => 'string',
                ]
            );

            throw new InvalidArgumentException($message, 400);
        } elseif (!is_string($path)) {
            $actualType = is_object($path) ? get_class($path) : gettype($path);
            $message = $translator->translate(
                '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}',
                [
                    '{{ parameter }}'    => '"path"',
                    '{{ expectedType }}' => 'string',
                    '{{ actualType }}'   => $actualType,
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }
    }
protected function assertValidPath($path)
    {
        $translator = $this->translator();

        if (empty($path) && !is_numeric($path)) {
            $message = $translator->translate(
                '{{ parameter }} required and must be a {{ expectedType }}',
                [
                    '{{ parameter }}'    => '"path"',
                    '{{ expectedType }}' => 'string',
                ]
            );

            throw new InvalidArgumentException($message, 400);
        } elseif (!is_string($path)) {
            $actualType = is_object($path) ? get_class($path) : gettype($path);
            $message = $translator->translate(
                '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}',
                [
                    '{{ parameter }}'    => '"path"',
                    '{{ expectedType }}' => 'string',
                    '{{ actualType }}'   => $actualType,
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }
    }
protected function assertValidPath ( $ path ) { $ translator = $ this -> translator ( ) ; if ( empty ( $ path ) && ! is_numeric ( $ path ) ) { $ message = $ translator -> translate ( '{{ parameter }} required and must be a {{ expectedType }}' , [ '{{ parameter }}' => '"path"' , '{{ expectedType }}' => 'string' , ] ) ; throw new InvalidArgumentException ( $ message , 400 ) ; } elseif ( ! is_string ( $ path ) ) { $ actualType = is_object ( $ path ) ? get_class ( $ path ) : gettype ( $ path ) ; $ message = $ translator -> translate ( '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}' , [ '{{ parameter }}' => '"path"' , '{{ expectedType }}' => 'string' , '{{ actualType }}' => $ actualType , ] ) ; throw new InvalidArgumentException ( $ message , 400 ) ; } }
Asserts that the path is valid, throws an exception if not.

@param  mixed $path A file path.
@throws InvalidArgumentException If the path is not a string.
@return void
Asserts that the path is valid throws an exception if not .