public function isValid()
    {
        foreach ($this->objects as $fileInfo) {
            // Before validation callback
            $this->applyCallback('beforeValidation', $fileInfo);

            // Check is uploaded file
            if ($fileInfo->isUploadedFile() === false) {
                $this->errors[] = sprintf(
                    '%s: %s',
                    $fileInfo->getNameWithExtension(),
                    'Is not an uploaded file'
                );
                continue;
            }

            // Apply user validations
            foreach ($this->validations as $validation) {
                try {
                    $validation->validate($fileInfo);
                } catch (\Upload\Exception $e) {
                    $this->errors[] = sprintf(
                        '%s: %s',
                        $fileInfo->getNameWithExtension(),
                        $e->getMessage()
                    );
                }
            }

            // After validation callback
            $this->applyCallback('afterValidation', $fileInfo);
        }

        return empty($this->errors);
    }
public function isValid()
    {
        foreach ($this->objects as $fileInfo) {
            // Before validation callback
            $this->applyCallback('beforeValidation', $fileInfo);

            // Check is uploaded file
            if ($fileInfo->isUploadedFile() === false) {
                $this->errors[] = sprintf(
                    '%s: %s',
                    $fileInfo->getNameWithExtension(),
                    'Is not an uploaded file'
                );
                continue;
            }

            // Apply user validations
            foreach ($this->validations as $validation) {
                try {
                    $validation->validate($fileInfo);
                } catch (\Upload\Exception $e) {
                    $this->errors[] = sprintf(
                        '%s: %s',
                        $fileInfo->getNameWithExtension(),
                        $e->getMessage()
                    );
                }
            }

            // After validation callback
            $this->applyCallback('afterValidation', $fileInfo);
        }

        return empty($this->errors);
    }
public function isValid ( ) { foreach ( $ this -> objects as $ fileInfo ) { // Before validation callback $ this -> applyCallback ( 'beforeValidation' , $ fileInfo ) ; // Check is uploaded file if ( $ fileInfo -> isUploadedFile ( ) === false ) { $ this -> errors [ ] = sprintf ( '%s: %s' , $ fileInfo -> getNameWithExtension ( ) , 'Is not an uploaded file' ) ; continue ; } // Apply user validations foreach ( $ this -> validations as $ validation ) { try { $ validation -> validate ( $ fileInfo ) ; } catch ( \ Upload \ Exception $ e ) { $ this -> errors [ ] = sprintf ( '%s: %s' , $ fileInfo -> getNameWithExtension ( ) , $ e -> getMessage ( ) ) ; } } // After validation callback $ this -> applyCallback ( 'afterValidation' , $ fileInfo ) ; } return empty ( $ this -> errors ) ; }
Is this collection valid and without errors?

@return bool
Is this collection valid and without errors?