public function url_stat($path, $flags)
    {
        stream_wrapper_restore('file');

        if ($flags & STREAM_URL_STAT_QUIET) {
            set_error_handler(static function () {
                // Use native error handler
                return false;
            });
            $result = @stat($path);
            restore_error_handler();
        } else {
            $result = stat($path);
        }

        stream_wrapper_unregister('file');
        stream_wrapper_register('file', self::class);

        return $result;
    }
public function url_stat($path, $flags)
    {
        stream_wrapper_restore('file');

        if ($flags & STREAM_URL_STAT_QUIET) {
            set_error_handler(static function () {
                // Use native error handler
                return false;
            });
            $result = @stat($path);
            restore_error_handler();
        } else {
            $result = stat($path);
        }

        stream_wrapper_unregister('file');
        stream_wrapper_register('file', self::class);

        return $result;
    }
public function url_stat ( $ path , $ flags ) { stream_wrapper_restore ( 'file' ) ; if ( $ flags & STREAM_URL_STAT_QUIET ) { set_error_handler ( static function ( ) { // Use native error handler return false ; } ) ; $ result = @ stat ( $ path ) ; restore_error_handler ( ) ; } else { $ result = stat ( $ path ) ; } stream_wrapper_unregister ( 'file' ) ; stream_wrapper_register ( 'file' , self :: class ) ; return $ result ; }
url_stat is triggered by calls like "file_exists". The call to "file_exists" must not be overloaded.
This function restores the original "file" stream, issues a call to "stat" to get the real results,
and then re-registers the AutoloadSourceLocator stream wrapper.

@see https://php.net/manual/en/class.streamwrapper.php
@see https://php.net/manual/en/streamwrapper.url-stat.php

@param string $path
@param int    $flags

@return mixed[]|bool

@phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
url_stat is triggered by calls like file_exists . The call to file_exists must not be overloaded . This function restores the original file stream issues a call to stat to get the real results and then re - registers the AutoloadSourceLocator stream wrapper .