src/Checker/FileChecker.php
public function extension($file, $extensions): bool
    {
        if (!is_array($extensions)) {
            $extensions = array_slice(func_get_args(), 1);
        }

        if ($file instanceof UploadedFileInterface) {
            return in_array(
                $this->files->extension($file->getClientFilename()),
                $extensions
            );
        }

        return in_array($this->files->extension($file), $extensions);
    }
public function extension($file, $extensions): bool
    {
        if (!is_array($extensions)) {
            $extensions = array_slice(func_get_args(), 1);
        }

        if ($file instanceof UploadedFileInterface) {
            return in_array(
                $this->files->extension($file->getClientFilename()),
                $extensions
            );
        }

        return in_array($this->files->extension($file), $extensions);
    }
public function extension ( $ file , $ extensions ) : bool { if ( ! is_array ( $ extensions ) ) { $ extensions = array_slice ( func_get_args ( ) , 1 ) ; } if ( $ file instanceof UploadedFileInterface ) { return in_array ( $ this -> files -> extension ( $ file -> getClientFilename ( ) ) , $ extensions ) ; } return in_array ( $ this -> files -> extension ( $ file ) , $ extensions ) ; }
Check if file extension in whitelist. Client name of uploaded file will be used!
It is recommended to use external validation like media type based on file mimetype or
ensure that resource is properly converted.

@param mixed        $file
@param array|string $extensions

@return bool
Check if file extension in whitelist . Client name of uploaded file will be used! It is recommended to use external validation like media type based on file mimetype or ensure that resource is properly converted .