@param taoResultServer_models_classes_ResponseVariable $rawVariable

@return taoResultServer_models_classes_ResponseVariable

@throws InvalidServiceManagerException
@throws common_exception_Error
@throws common_exception_NotFound
969638
private function restoreFile(taoResultServer_models_classes_ResponseVariable $rawVariable)
    {
        $variable = clone $rawVariable;

        $path = $variable->getCandidateResponse();
        $fileContent = $this->getFileSystem()->read($path);

        $variable->setCandidateResponse($fileContent);
        $variable->setBaseType('file');

        return $variable;
    }
259625
@Override
    public Object processResponse(Object rawResponse) throws ServiceException {
        PipelineHelpers.throwIfNotSuccess((ClientResponse) rawResponse);
        return rawResponse;
    }
1306219
public static filterhtmlinjectionvariable get(nitro_service service, String variable) throws Exception{
		filterhtmlinjectionvariable obj = new filterhtmlinjectionvariable();
		obj.set_variable(variable);
		filterhtmlinjectionvariable response = (filterhtmlinjectionvariable) obj.get_resource(service);
		return response;
	}
1051467
protected function returnSuccess($rawData = array(), $withMessage=true)
    {
        $data = array();
        if ($withMessage) {
            $data['success'] = true;
            $data['data'] = $rawData;
            $data['version'] = TAO_VERSION;
        } else {
            $data = $rawData;
        }

        $this->returnJson($data);
//        exit(0);
    }
120223
static function typecastVariable($variable, string $type) {
        if($variable === null) {
            return null;
        }
        
        switch($type) {
            case 'array':
                $variable = (array) $variable;
            break;
            case 'bool':
                $variable = (bool) $variable;
            break;
            case 'float':
                $variable = (float) $variable;
            break;
            case 'int':
                $variable = (int) $variable;
            break;
            case 'string':
                $variable = (string) $variable;
            break;
            default:
                throw new \InvalidArgumentException('Unsupported type "'.$type.'"');
            break;
        }
        
        return $variable;
    }
975239
public function setRawResponse(\Psr\Http\Message\ResponseInterface $rawResponse): self {
        $this->rawResponse = $rawResponse;

        return $this;
    }
1310523
protected function getResultVariables($resultId, $filterSubmission, $filterTypes = array())
    {
        $resultService = $this->getResultsService();
        $variables = $resultService->getStructuredVariables($resultId, $filterSubmission, array_merge($filterTypes, [\taoResultServer_models_classes_ResponseVariable::class]));
        $displayedVariables = $resultService->filterStructuredVariables($variables, $filterTypes);
        $responses = ResponseVariableFormatter::formatStructuredVariablesToItemState($variables);
        $excludedVariables = array_flip(['numAttempts', 'duration']);

        foreach ($displayedVariables as &$item) {
            if (!isset($item['uri'])) {
                continue;
            }
            $itemUri = $item['uri'];
            $item['state'] = isset($responses[$itemUri][$item['attempt']])
                ? json_encode(array_diff_key($responses[$itemUri][$item['attempt']], $excludedVariables))
                : null;
        }

        return $displayedVariables;
    }
1197683
public function getRawPropertyPriority( $rawName )
    {
        if ( isset( $this->properties[$rawName]['priority'] ) )
        {
            return $this->properties[$rawName]['priority'];
        }

        return null;
    }
989417
protected function displayVariable(ApiResource $variable)
    {
        /** @var \Platformsh\Cli\Service\Table $table */
        $table = $this->getService('table');
        /** @var \Platformsh\Cli\Service\PropertyFormatter $formatter */
        $formatter = $this->getService('property_formatter');

        $properties = $variable->getProperties();
        $properties['level'] = $this->getVariableLevel($variable);

        $headings = [];
        $values = [];
        foreach ($properties as $key => $value) {
            $headings[] = new AdaptiveTableCell($key, ['wrap' => false]);
            if ($key === 'value') {
                $value = wordwrap($value, 80, "\n", true);
            }
            $values[] = $formatter->format($value, $key);
        }
        $table->renderSimple($values, $headings);
    }
656556
public final static function factory( & $variable, $name = null )
	{
		isset( self::$_customDataTypes ) or self::_init();

		# save internal data to revert after dumping to properly handle recursions etc
		$revert = array(
			'level'   => self::$_level,
			'objects' => self::$_objects,
		);

		self::$_level++;

		$name          = self::_escape( $name );
		$varData       = new kintVariableData;
		$varData->name = $name;

		# first parse the variable based on its type
		$varType = gettype( $variable );
		$varType === 'unknown type' and $varType = 'unknown'; # PHP 5.4 inconsistency
		$methodName = '_parse_' . $varType;

		# base type parser returning false means "stop processing further": e.g. recursion
		if ( self::$methodName( $variable, $varData ) === false ) {
			self::$_level--;
			return $varData;
		}

		if ( !self::$_skipAlternatives) {
			# if an alternative returns something that can be represented in an alternative way, don't :)
			self::$_skipAlternatives = true;

			# now check whether the variable can be represented in a different way
			foreach ( self::$_customDataTypes as $parserClass ) {
				$className = '\\Arx\\classes\\debug\\Kint_Parsers_' . $parserClass;

				/** @var $object kintParser */
				$object       = new $className;

				$object->name = $name; # the parser may overwrite the name value, so set it first

				if ( $object->_parse( $variable ) !== false ) {
					$varData->alternatives[] = $object;
				}
			}


			# combine extended values with alternative representations if applicable
			if ( !empty( $varData->alternatives ) && isset( $varData->extendedValue ) ) {
				$a = new kintVariableData;

				$a->value = $varData->extendedValue;
				$a->type  = $varData->type;
				$a->size  = $varData->size;

				array_unshift( $varData->alternatives, $a );
				$varData->extendedValue = null;
			}

			self::$_skipAlternatives = false;
		}

		self::$_level   = $revert['level'];
		self::$_objects = $revert['objects'];
		return $varData;
	}
1114518
protected static function classFromJson(BunqResponseRaw $responseRaw): BunqResponse
    {
        $json = $responseRaw->getBodyString();
        $response = ModelUtil::deserializeResponseArray($json)[self::FIELD_RESPONSE];
        $formattedResponseArray = ModelUtil::formatResponseArray($response);
        $value = static::createFromResponseArray($formattedResponseArray);

        return new BunqResponse($value, $responseRaw->getHeaders());
    }
326694
protected function createResponseException($actualCode, $respBody)
    {
        $exceptionCode    = $actualCode;
        $exceptionMessage = "Unexpected protobuf response code: " . $actualCode;

        if ($actualCode === RiakMessageCodes::ERROR_RESP) {
            $errorClass   = self::$respClassMap[$actualCode];
            $errorMessage = Protobuf::decode($errorClass, (string) $respBody);

            if ($errorMessage->hasErrmsg()) {
                $exceptionMessage  = $errorMessage->getErrmsg();
            }

            if ($errorMessage->hasErrcode()) {
                $exceptionCode = $errorMessage->getErrcode();
            }
        }

        return new RiakTransportException($exceptionMessage, $exceptionCode);
    }
1137051
public function evaluate($variable = array())
    {
        
        common_Logger::i('Evaluating Operation uri : '. $this->getUri(), array('Generis Operation'));
        common_Logger::i('Evaluating Operation name : '. $this->getLabel(), array('Generis Operation'));
        
        $operator = $this->getOperator();
        common_Logger::d('Operator uri: '. $operator->getUri(), array('Generis Operation'));
        common_Logger::d('Operator name: '. $operator->getLabel(), array('Generis Operation'));         

	    $firstPart = $this->getFirstOperation()->evaluate($variable);
	    $secondPart = $this->getSecondOperation()->evaluate($variable);


		if($firstPart instanceof core_kernel_classes_ContainerCollection ) {
			//if we have more than one result we only take the Literal label
			$nbLiteral = 0;
			$iterator = $firstPart->getIterator();
			foreach ($iterator as $first) {
				if ($first instanceof core_kernel_classes_Literal ) {
					$firstPart = $first;
					$nbLiteral++;
				}
				
			}
			if ($nbLiteral != 1){
				var_dump($iterator);
				throw new common_Exception('more than one Literal Retreive during  evaluation');
			}
    	}


   		
    	if($secondPart instanceof core_kernel_classes_ContainerCollection ) {
    		//if we have more than one result we only take the resource label
			$nbLiteral = 0;
			$iterator = $secondPart->getIterator();
			foreach ($secondPart->getIterator() as $second) {
				if ($second instanceof core_kernel_classes_Literal) {
					$secondPart = $second;
					$nbLiteral++;
				}

			}
			if ($nbLiteral != 1){
				var_dump($iterator);
				throw new common_Exception('more than one Literal Retreive during evaluation');
			}
    	}

    	common_Logger::d('First Part : ', array('Generis Operation'));
    	common_Logger::d('Second Part : '. $secondPart, array('Generis Operation'));
    	$returnValue = $this->evaluateRecursiveOperation($firstPart,$secondPart,$operator);
    	common_Logger::i('Operation value: '. $returnValue, array('Generis Operation'));
    	
    	return $returnValue;
        
    }
1098729
public function getVariableColumns($delivery, $variableClassUri)
    {
        $columns = array();
        /** @var ResultServiceWrapper $resultServiceWrapper */
        $resultServiceWrapper = $this->getServiceLocator()->get(ResultServiceWrapper::SERVICE_ID);

        $this->setImplementation($this->getReadableImplementation($delivery));
        //The list of delivery Results matching the current selection filters
        $results = $this->getImplementation()->getResultByDelivery([$delivery->getUri()]);

        //retrieveing all individual response variables referring to the  selected delivery results
        $itemIndex = $this->getItemIndexer($delivery);

        $resultsIds  = array_column($results, 'deliveryResultIdentifier');

        //retrieving The list of the variables identifiers per activities defintions as observed
        $variableTypes = array();

        $resultLanguage = $this->getResultLanguage();

        foreach (array_chunk($resultsIds, $resultServiceWrapper->getOption(ResultServiceWrapper::RESULT_COLUMNS_CHUNK_SIZE_OPTION)) as $resultsIdsItem) {
            $selectedVariables = $this->getResultsVariables($resultsIdsItem);
            foreach ($selectedVariables as $variable) {
                $variable = $variable[0];
                if($this->isResultVariable($variable, $variableClassUri)) {
                    //variableIdentifier
                    $variableIdentifier = $variable->variable->identifier;
                    if (!is_null($variable->item)) {
                        $uri = $variable->item;
                        $contextIdentifierLabel = $itemIndex->getItemValue($uri, $resultLanguage, 'label');
                    } else {
                        $uri = $variable->test;
                        $testData = $this->getTestMetadata($delivery, $variable->test);
                        $contextIdentifierLabel = $testData->getLabel();
                    }

                    $variableTypes[$uri.$variableIdentifier] = array("contextLabel" => $contextIdentifierLabel, "contextId" => $uri, "variableIdentifier" => $variableIdentifier);
                }
            }
        }

        foreach ($variableTypes as $variableType){

            switch ($variableClassUri){
                case \taoResultServer_models_classes_OutcomeVariable::class :
                    $columns[] = new GradeColumn($variableType["contextId"], $variableType["contextLabel"], $variableType["variableIdentifier"]);
                    break;
                case \taoResultServer_models_classes_ResponseVariable::class :
                    $columns[] = new ResponseColumn($variableType["contextId"], $variableType["contextLabel"], $variableType["variableIdentifier"]);
                    break;
                default:
                    $columns[] = new ResponseColumn($variableType["contextId"], $variableType["contextLabel"], $variableType["variableIdentifier"]);
            }
        }
        $arr = array();
        foreach ($columns as $column) {
            $arr[] = $column->toArray();
        }
        return $arr;
    }
801480
public function setRawProperty( $rawName, $value,
                                    $priority = self::PRIORITY_NORMAL )
    {
        if ( is_array( $value ) )
        {
            $value = (object) $value;
        }

        if ( is_object( $value ) )
        {
            if ( isset( $value->priority ) )
            {
                $priority = $value->priority;
            }

            if ( isset( $value->value ) )
            {
                $value = $value->value;
            }
            else
            {
                $value = null;
            }
        }

        $rawName    = (string) $rawName;
        $value      = (string) $value;
        $priority   = ( (string) $priority ) ?: self::PRIORITY_NORMAL;

        if ( '' === $value )
        {
            return $this->removeRawProperty( $rawName );
        }

        $this->properties[$rawName] = array(
            'name'      => $rawName,
            'value'     => $value,
            'priority'  => $priority,
        );

        return $this;
    }
677630
public function getRequestParameter($name, $raw = false)
    {
        $value = null;

        $value = $this->getPostParameter($name, $raw);
        if (!isset($value)) {
            $value = $this->getGetParameter($name, $raw);
        }

        return $value;
    }
738823
public static function fromRaw(array $raw)
    {
        $last = $raw[count($raw) - 2];
        if (strncmp($last, 'ACK', 3) === 0) {
            return self::produceFailResponse($last);
        }
        array_pop($raw);
        array_pop($raw);
        return new self($raw);
    }