public function upload($destination, array $files)
    {
        foreach ($files as $file) {
            if (!($file instanceof FileEntity)) {
                // This should never occur, but it's always better not to rely on framework users
                throw new LogicException(sprintf(
                    'Each file entity must be an instance of \Krystal\Http\FileTransfer\FileInfoInterface, but received "%s"', gettype($file)
                ));
            }

            // Gotta ensure again, UPLOAD_ERR_OK means there are no errors
            if ($file->getError() == \UPLOAD_ERR_OK) {
                // Start trying to move a file
                if (!$this->move($destination, $file->getTmpName(), $file->getUniqueName())) {
                    return false;
                }
            } else {
                // Invalid file, so that cannot be uploaded. That actually should be reported before inside validator
                return false;
            }
        }

        return true;
    }
public function upload($destination, array $files)
    {
        foreach ($files as $file) {
            if (!($file instanceof FileEntity)) {
                // This should never occur, but it's always better not to rely on framework users
                throw new LogicException(sprintf(
                    'Each file entity must be an instance of \Krystal\Http\FileTransfer\FileInfoInterface, but received "%s"', gettype($file)
                ));
            }

            // Gotta ensure again, UPLOAD_ERR_OK means there are no errors
            if ($file->getError() == \UPLOAD_ERR_OK) {
                // Start trying to move a file
                if (!$this->move($destination, $file->getTmpName(), $file->getUniqueName())) {
                    return false;
                }
            } else {
                // Invalid file, so that cannot be uploaded. That actually should be reported before inside validator
                return false;
            }
        }

        return true;
    }
public function upload ( $ destination , array $ files ) { foreach ( $ files as $ file ) { if ( ! ( $ file instanceof FileEntity ) ) { // This should never occur, but it's always better not to rely on framework users throw new LogicException ( sprintf ( 'Each file entity must be an instance of \Krystal\Http\FileTransfer\FileInfoInterface, but received "%s"' , gettype ( $ file ) ) ) ; } // Gotta ensure again, UPLOAD_ERR_OK means there are no errors if ( $ file -> getError ( ) == \ UPLOAD_ERR_OK ) { // Start trying to move a file if ( ! $ this -> move ( $ destination , $ file -> getTmpName ( ) , $ file -> getUniqueName ( ) ) ) { return false ; } } else { // Invalid file, so that cannot be uploaded. That actually should be reported before inside validator return false ; } } return true ; }
Upload files from the input

@param string $destination
@param array $files
@throws \LogicException if at least one value in $files is not an instance of \Krystal\Http\FileTransfer\FileEntityInterface
@return boolean
Upload files from the input