src/Factory/UserFactory.php
public static function createFromFileOwner($filename)
    {
        if (!file_exists($filename)) {
            throw new \InvalidArgumentException('Invalid file name provided.');
        }
        if (!function_exists('posix_getuid')) {
            throw new PosixNotAvailableException(
                'Could not retrieve information about the operating system user because POSIX functions '
                . 'are not available to your PHP executable.'
            );
        }
        if (false === $uid = \fileowner($filename)) {
            throw new \Exception('Could not get the owner of the file "' . $filename . '".');
        }
        return new User($uid);
    }
public static function createFromFileOwner($filename)
    {
        if (!file_exists($filename)) {
            throw new \InvalidArgumentException('Invalid file name provided.');
        }
        if (!function_exists('posix_getuid')) {
            throw new PosixNotAvailableException(
                'Could not retrieve information about the operating system user because POSIX functions '
                . 'are not available to your PHP executable.'
            );
        }
        if (false === $uid = \fileowner($filename)) {
            throw new \Exception('Could not get the owner of the file "' . $filename . '".');
        }
        return new User($uid);
    }
public static function createFromFileOwner ( $ filename ) { if ( ! file_exists ( $ filename ) ) { throw new \ InvalidArgumentException ( 'Invalid file name provided.' ) ; } if ( ! function_exists ( 'posix_getuid' ) ) { throw new PosixNotAvailableException ( 'Could not retrieve information about the operating system user because POSIX functions ' . 'are not available to your PHP executable.' ) ; } if ( false === $ uid = \ fileowner ( $ filename ) ) { throw new \ Exception ( 'Could not get the owner of the file "' . $ filename . '".' ) ; } return new User ( $ uid ) ; }
Factory method to get the owner of a file.

@param string    $filename

@return User

@throws PosixNotAvailableException
@throws \Exception
Factory method to get the owner of a file .