public function getStreamContext($verb = 'GET', $opts = [])
    {
        $o = array_merge_recursive($this->getContextOptions(), $opts);
        $o['http']['method'] = $verb;

        if (substr($verb, 0, 5) == 'PATCH') {
            /**
             * https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#patch-operations
             * https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
             *
             * Content-Type: application/json-patch+json
             * Content-Type: application/merge-patch+json
             * Content-Type: application/strategic-merge-patch+json
             */
            switch ($verb) {
                case 'PATCH-JSON':
                    $o['http']['header'] .= "Content-Type: application/json-patch+json\r\n";
                    break;
                case 'PATCH-STRATEGIC-MERGE':
                    $o['http']['header'] .= "Content-Type: application/strategic-merge-patch+json\r\n";
                    break;
                case 'PATCH':
                case 'PATCH-MERGE':
                default:
                    $o['http']['header'] .= "Content-Type: application/merge-patch+json\r\n";
                    break;
            }
        } else {
            $o['http']['header'] .= "Content-Type: application/json\r\n";
        }

        return stream_context_create($o);
    }
public function getStreamContext($verb = 'GET', $opts = [])
    {
        $o = array_merge_recursive($this->getContextOptions(), $opts);
        $o['http']['method'] = $verb;

        if (substr($verb, 0, 5) == 'PATCH') {
            /**
             * https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#patch-operations
             * https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
             *
             * Content-Type: application/json-patch+json
             * Content-Type: application/merge-patch+json
             * Content-Type: application/strategic-merge-patch+json
             */
            switch ($verb) {
                case 'PATCH-JSON':
                    $o['http']['header'] .= "Content-Type: application/json-patch+json\r\n";
                    break;
                case 'PATCH-STRATEGIC-MERGE':
                    $o['http']['header'] .= "Content-Type: application/strategic-merge-patch+json\r\n";
                    break;
                case 'PATCH':
                case 'PATCH-MERGE':
                default:
                    $o['http']['header'] .= "Content-Type: application/merge-patch+json\r\n";
                    break;
            }
        } else {
            $o['http']['header'] .= "Content-Type: application/json\r\n";
        }

        return stream_context_create($o);
    }
public function getStreamContext ( $ verb = 'GET' , $ opts = [ ] ) { $ o = array_merge_recursive ( $ this -> getContextOptions ( ) , $ opts ) ; $ o [ 'http' ] [ 'method' ] = $ verb ; if ( substr ( $ verb , 0 , 5 ) == 'PATCH' ) { /**
             * https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#patch-operations
             * https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
             *
             * Content-Type: application/json-patch+json
             * Content-Type: application/merge-patch+json
             * Content-Type: application/strategic-merge-patch+json
             */ switch ( $ verb ) { case 'PATCH-JSON' : $ o [ 'http' ] [ 'header' ] .= "Content-Type: application/json-patch+json\r\n" ; break ; case 'PATCH-STRATEGIC-MERGE' : $ o [ 'http' ] [ 'header' ] .= "Content-Type: application/strategic-merge-patch+json\r\n" ; break ; case 'PATCH' : case 'PATCH-MERGE' : default : $ o [ 'http' ] [ 'header' ] .= "Content-Type: application/merge-patch+json\r\n" ; break ; } } else { $ o [ 'http' ] [ 'header' ] .= "Content-Type: application/json\r\n" ; } return stream_context_create ( $ o ) ; }
Get the stream context

@param string $verb
@param array $opts
@return resource
Get the stream context