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

        if ($disk === null) {
            $message = $translator->translate(
                'Default filesystem [{{ defaultFilesystemConnection }}] is not defined',
                [
                    '{{ defaultFilesystemConnection }}' => 'config.filesystem.default_connection'
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }

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

            throw new InvalidArgumentException($message, 400);
        }

        if (!isset($this->filesystems[$disk])) {
            $message = $translator->translate('Filesystem identifier "{{ fsIdent }}" is not defined.', [
                '{{ fsIdent }}' => $disk
            ]);

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

        if ($disk === null) {
            $message = $translator->translate(
                'Default filesystem [{{ defaultFilesystemConnection }}] is not defined',
                [
                    '{{ defaultFilesystemConnection }}' => 'config.filesystem.default_connection'
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }

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

            throw new InvalidArgumentException($message, 400);
        }

        if (!isset($this->filesystems[$disk])) {
            $message = $translator->translate('Filesystem identifier "{{ fsIdent }}" is not defined.', [
                '{{ fsIdent }}' => $disk
            ]);

            throw new InvalidArgumentException($message, 400);
        }
    }
protected function assertValidDisk ( $ disk ) { $ translator = $ this -> translator ( ) ; if ( $ disk === null ) { $ message = $ translator -> translate ( 'Default filesystem [{{ defaultFilesystemConnection }}] is not defined' , [ '{{ defaultFilesystemConnection }}' => 'config.filesystem.default_connection' ] ) ; throw new InvalidArgumentException ( $ message , 400 ) ; } if ( ! is_string ( $ disk ) ) { $ actualType = is_object ( $ disk ) ? get_class ( $ disk ) : gettype ( $ disk ) ; $ message = $ translator -> translate ( '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}' , [ '{{ parameter }}' => '"disk"' , '{{ expectedType }}' => 'string' , '{{ actualType }}' => $ actualType , ] ) ; throw new InvalidArgumentException ( $ message , 400 ) ; } if ( ! isset ( $ this -> filesystems [ $ disk ] ) ) { $ message = $ translator -> translate ( 'Filesystem identifier "{{ fsIdent }}" is not defined.' , [ '{{ fsIdent }}' => $ disk ] ) ; throw new InvalidArgumentException ( $ message , 400 ) ; } }
Asserts that the filesystem connection is valid, throws an exception if not.

@param  mixed $disk A filesystem connection identifier.
@throws InvalidArgumentException If the filesystem is not a string or NULL.
@return void
Asserts that the filesystem connection is valid throws an exception if not .