private function determineOperationRequirements()
    {
        if (null === $this->requiredPayloadTokens) {
            $this->requiredPayloadTokens = [];

            $valueSources = ['value', 'default_value'];
            if ($this->test) {
                $valueSources = ['test_value', 'value', 'default_value'];
            }

            foreach ($this->operations as $id => $operation) {
                if (isset($operation->request)) {
                    // Check the request for payload tokens dependent on previous operations.
                    foreach (['headers', 'body'] as $fieldType) {
                        if (is_array($operation->request->{$fieldType})) {
                            foreach ($operation->request->{$fieldType} as $field) {
                                foreach ($valueSources as $valueSource) {
                                    if (!empty($field->{$valueSource})) {
                                        $tokens = $this->tokenHelper->getTokens($field->{$valueSource});
                                        if ($tokens) {
                                            // Check for tokens that use the payload of a previous operation.
                                            foreach ($tokens as $token) {
                                                $parts = explode('.', $token);
                                                if (
                                                    isset($parts[0])
                                                    && 'payload' === $parts[0]
                                                    && isset($parts[1])
                                                    && 'operations' === $parts[1]
                                                    && isset($parts[2])
                                                    && is_numeric($parts[2])
                                                    && isset($parts[3])
                                                    && 'response' === $parts[3]
                                                    && in_array($parts[4], ['headers', 'body'])
                                                    && isset($parts[5])
                                                ) {
                                                    if (!isset($this->requiredPayloadTokens[$parts[2]])) {
                                                        $this->requiredPayloadTokens[$parts[2]] = [];
                                                    }
                                                    $this->requiredPayloadTokens[$parts[2]][] = $token;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
private function determineOperationRequirements()
    {
        if (null === $this->requiredPayloadTokens) {
            $this->requiredPayloadTokens = [];

            $valueSources = ['value', 'default_value'];
            if ($this->test) {
                $valueSources = ['test_value', 'value', 'default_value'];
            }

            foreach ($this->operations as $id => $operation) {
                if (isset($operation->request)) {
                    // Check the request for payload tokens dependent on previous operations.
                    foreach (['headers', 'body'] as $fieldType) {
                        if (is_array($operation->request->{$fieldType})) {
                            foreach ($operation->request->{$fieldType} as $field) {
                                foreach ($valueSources as $valueSource) {
                                    if (!empty($field->{$valueSource})) {
                                        $tokens = $this->tokenHelper->getTokens($field->{$valueSource});
                                        if ($tokens) {
                                            // Check for tokens that use the payload of a previous operation.
                                            foreach ($tokens as $token) {
                                                $parts = explode('.', $token);
                                                if (
                                                    isset($parts[0])
                                                    && 'payload' === $parts[0]
                                                    && isset($parts[1])
                                                    && 'operations' === $parts[1]
                                                    && isset($parts[2])
                                                    && is_numeric($parts[2])
                                                    && isset($parts[3])
                                                    && 'response' === $parts[3]
                                                    && in_array($parts[4], ['headers', 'body'])
                                                    && isset($parts[5])
                                                ) {
                                                    if (!isset($this->requiredPayloadTokens[$parts[2]])) {
                                                        $this->requiredPayloadTokens[$parts[2]] = [];
                                                    }
                                                    $this->requiredPayloadTokens[$parts[2]][] = $token;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
private function determineOperationRequirements ( ) { if ( null === $ this -> requiredPayloadTokens ) { $ this -> requiredPayloadTokens = [ ] ; $ valueSources = [ 'value' , 'default_value' ] ; if ( $ this -> test ) { $ valueSources = [ 'test_value' , 'value' , 'default_value' ] ; } foreach ( $ this -> operations as $ id => $ operation ) { if ( isset ( $ operation -> request ) ) { // Check the request for payload tokens dependent on previous operations. foreach ( [ 'headers' , 'body' ] as $ fieldType ) { if ( is_array ( $ operation -> request -> { $ fieldType } ) ) { foreach ( $ operation -> request -> { $ fieldType } as $ field ) { foreach ( $ valueSources as $ valueSource ) { if ( ! empty ( $ field -> { $ valueSource } ) ) { $ tokens = $ this -> tokenHelper -> getTokens ( $ field -> { $ valueSource } ) ; if ( $ tokens ) { // Check for tokens that use the payload of a previous operation. foreach ( $ tokens as $ token ) { $ parts = explode ( '.' , $ token ) ; if ( isset ( $ parts [ 0 ] ) && 'payload' === $ parts [ 0 ] && isset ( $ parts [ 1 ] ) && 'operations' === $ parts [ 1 ] && isset ( $ parts [ 2 ] ) && is_numeric ( $ parts [ 2 ] ) && isset ( $ parts [ 3 ] ) && 'response' === $ parts [ 3 ] && in_array ( $ parts [ 4 ] , [ 'headers' , 'body' ] ) && isset ( $ parts [ 5 ] ) ) { if ( ! isset ( $ this -> requiredPayloadTokens [ $ parts [ 2 ] ] ) ) { $ this -> requiredPayloadTokens [ $ parts [ 2 ] ] = [ ] ; } $ this -> requiredPayloadTokens [ $ parts [ 2 ] ] [ ] = $ token ; } } } } } } } } } } } }
Discern the tokens that are required by operation ID.
Discern the tokens that are required by operation ID .