src/Exception/ValidationException.php
protected function generateErrors($alias, array $array, $directory, $translate)
    {
        $errors = [];

        foreach ($array as $key => $object)
        {
            if (is_array($object))
            {
                $errors[ $key ] = ($key === '_external')
                    // Search for errors in $alias/_external.php
                    ? $this->generateErrors($alias . '/' . $key, $object, $directory, $translate)
                    // Regular models get their own file not nested within $alias
                    : $this->generateErrors($key, $object, $directory, $translate);
            }
            elseif ($object instanceof Validation)
            {
                if (null === $directory)
                {
                    // Return the raw errors
                    $file = null;
                }
                else
                {
                    $file = trim($directory . '/' . $alias, '/');
                }

                $errors += $object->errors($file, $translate);
            }
        }

        return $errors;
    }
protected function generateErrors($alias, array $array, $directory, $translate)
    {
        $errors = [];

        foreach ($array as $key => $object)
        {
            if (is_array($object))
            {
                $errors[ $key ] = ($key === '_external')
                    // Search for errors in $alias/_external.php
                    ? $this->generateErrors($alias . '/' . $key, $object, $directory, $translate)
                    // Regular models get their own file not nested within $alias
                    : $this->generateErrors($key, $object, $directory, $translate);
            }
            elseif ($object instanceof Validation)
            {
                if (null === $directory)
                {
                    // Return the raw errors
                    $file = null;
                }
                else
                {
                    $file = trim($directory . '/' . $alias, '/');
                }

                $errors += $object->errors($file, $translate);
            }
        }

        return $errors;
    }
protected function generateErrors ( $ alias , array $ array , $ directory , $ translate ) { $ errors = [ ] ; foreach ( $ array as $ key => $ object ) { if ( is_array ( $ object ) ) { $ errors [ $ key ] = ( $ key === '_external' ) // Search for errors in $alias/_external.php ? $ this -> generateErrors ( $ alias . '/' . $ key , $ object , $ directory , $ translate ) // Regular models get their own file not nested within $alias : $ this -> generateErrors ( $ key , $ object , $ directory , $ translate ) ; } elseif ( $ object instanceof Validation ) { if ( null === $ directory ) { // Return the raw errors $ file = null ; } else { $ file = trim ( $ directory . '/' . $ alias , '/' ) ; } $ errors += $ object -> errors ( $ file , $ translate ) ; } } return $ errors ; }
Recursive method to fetch all the errors in this exception

@param  string $alias     Alias to use for messages file
@param  array  $array     Array of Validation objects to get errors from
@param  string $directory Directory to load error messages from
@param  mixed  $translate Translate the message
@return array
Recursive method to fetch all the errors in this exception