private function decorateHostsFileExecutor(ExecutorInterface $executor)
    {
        try {
            $executor = new HostsFileExecutor(
                HostsFile::loadFromPathBlocking(),
                $executor
            );
        } catch (\RuntimeException $e) {
            // ignore this file if it can not be loaded
        }

        // Windows does not store localhost in hosts file by default but handles this internally
        // To compensate for this, we explicitly use hard-coded defaults for localhost
        if (DIRECTORY_SEPARATOR === '\\') {
            $executor = new HostsFileExecutor(
                new HostsFile("127.0.0.1 localhost\n::1 localhost"),
                $executor
            );
        }

        return $executor;
    }
private function decorateHostsFileExecutor(ExecutorInterface $executor)
    {
        try {
            $executor = new HostsFileExecutor(
                HostsFile::loadFromPathBlocking(),
                $executor
            );
        } catch (\RuntimeException $e) {
            // ignore this file if it can not be loaded
        }

        // Windows does not store localhost in hosts file by default but handles this internally
        // To compensate for this, we explicitly use hard-coded defaults for localhost
        if (DIRECTORY_SEPARATOR === '\\') {
            $executor = new HostsFileExecutor(
                new HostsFile("127.0.0.1 localhost\n::1 localhost"),
                $executor
            );
        }

        return $executor;
    }
private function decorateHostsFileExecutor ( ExecutorInterface $ executor ) { try { $ executor = new HostsFileExecutor ( HostsFile :: loadFromPathBlocking ( ) , $ executor ) ; } catch ( \ RuntimeException $ e ) { // ignore this file if it can not be loaded } // Windows does not store localhost in hosts file by default but handles this internally // To compensate for this, we explicitly use hard-coded defaults for localhost if ( DIRECTORY_SEPARATOR === '\\' ) { $ executor = new HostsFileExecutor ( new HostsFile ( "127.0.0.1 localhost\n::1 localhost" ) , $ executor ) ; } return $ executor ; }
Tries to load the hosts file and decorates the given executor on success

@param ExecutorInterface $executor
@return ExecutorInterface
@codeCoverageIgnore
Tries to load the hosts file and decorates the given executor on success