Applies operation to data source and returns modified data source.

@param $src
@param OperationInterface|CustomOperation $operation
@return mixed modified data source
337159
public function process($src, OperationInterface $operation)
    {
        $callable = $operation->getCallback();
        $arguments = array_merge([$src], $operation->getArguments());
        $res = call_user_func_array($callable, $arguments);
        return $res ?: $src;
    }
791963
private function getOperations(\SimpleXMLElement $resource, string $operationType): ?array
    {
        $graphql = 'operation' === $operationType;
        if (!$graphql && $legacyOperations = $this->getAttributes($resource, $operationType)) {
            @trigger_error(
                sprintf('Configuring "%1$s" tags without using a parent "%1$ss" tag is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3', $operationType),
                E_USER_DEPRECATED
            );

            return $legacyOperations;
        }

        $operationsParent = $graphql ? 'graphql' : "{$operationType}s";
        if (!isset($resource->{$operationsParent})) {
            return null;
        }

        return $this->getAttributes($resource->{$operationsParent}, $operationType, true);
    }
1052162
public function process($src, OperationInterface $operation)
    {
        return array_slice(
            $src,
            $this->getOffset($operation),
            $operation->getPageSize()
        );
    }
1192489
private function runOperation(Operation $operation)
    {
        try {
            return $this->runner->run($operation);
        } catch (\Throwable $e) {
            // treated below
        } catch (\Exception $e) {
            // treated below
        }

        // @todo keep only inner if once ExceptionCatcher is gone
        if ($this->exceptionCatcherVoter instanceof ThrowableCatcherVoter) {
            if (!$this->exceptionCatcherVoter->shouldCatchThrowable($e)) {
                throw $e;
            }
        } elseif (!$this->exceptionCatcherVoter->shouldCatch($e)) {
            throw $e;
        }

        try {
            $this->waitStrategy->wait();
        } catch (WaiterException $waiterException) {
            throw $e;
        }

        return $this->runOperation($operation);
    }
99669
public function ExecuteRequest($operation, $params = array())
	{
		$params = array_replace($this->GetWSInitialRequest($operation), $params); 

		$results = parent::ExecuteRequest($operation, $params);

		$this->_CheckErrors($operation, $results);

		return $results->{$operation.'Result'};
	}
778268
private function eventQuery(string $fact, string $operation)
    {
        return DB::table('dates')
            ->select(['d_gid as id', 'd_year as year', 'd_fact AS fact', 'd_type AS type'])
            ->where('d_file', '=', $this->tree->id())
            ->where('d_fact', '=', $fact)
            ->where('d_julianday1', '=', function (Builder $query) use ($operation, $fact): void {
                $query->selectRaw($operation . '(d_julianday1)')
                    ->from('dates')
                    ->where('d_file', '=', $this->tree->id())
                    ->where('d_fact', '=', $fact)
                    ->where('d_julianday1', '<>', 0);
            })
            ->first();
    }
1130073
public function after(
        CommandInterface $command,
        RequestInterface $request,
        Operation $operation
    ) {
        $data = $this->jsonData;
        $this->jsonData = [];

        // Add additional parameters to the JSON document
        $additional = $operation->getAdditionalParameters();
        if ($additional && ($additional->getLocation() === $this->locationName)) {
            foreach ($command->toArray() as $key => $value) {
                if (!$operation->hasParam($key)) {
                    $data[$key] = $this->prepareValue($value, $additional);
                }
            }
        }

        // Don't overwrite the Content-Type if one is set
        if ($this->jsonContentType && !$request->hasHeader('Content-Type')) {
            $request = $request->withHeader('Content-Type', $this->jsonContentType);
        }

        return $request->withBody(Psr7\stream_for(\GuzzleHttp\json_encode($data)));
    }
129745
private function getOperationHandler(OperationInterface $operation)
    {
        foreach ($this->operationHandlers as $operationHandler) {
            if ($operationHandler->supports($operation)) {
                return $operationHandler;
            }
        }

        return null;
    }
715554
public function after(
        CommandInterface $command,
        RequestInterface $request,
        Operation $operation
    ) {
        $data = $this->formParamsData;
        $this->formParamsData = [];
        $modify = [];

        // Add additional parameters to the form_params array
        $additional = $operation->getAdditionalParameters();
        if ($additional && $additional->getLocation() == $this->locationName) {
            foreach ($command->toArray() as $key => $value) {
                if (!$operation->hasParam($key)) {
                    $data['form_params'][$key] = $this->prepareValue($value, $additional);
                }
            }
        }

        $body = http_build_query($data['form_params'], '', '&');
        $modify['body'] = Psr7\stream_for($body);
        $modify['set_headers']['Content-Type'] = $this->contentType;
        $request = Psr7\modify_request($request, $modify);

        return $request;
    }
979485
protected static function getLibraryPackage(OperationInterface $operation)
    {
        $package = static::getOperationPackage($operation);
        $data = null;

        if ($package && !static::isAsset($package)) {
            $data = $package;
        }

        return $data;
    }
523153
private function execCommand($operation, array $params)
    {
        // Create the command.
        $command = $this->client->getCommand(
            $this->info['command'][$operation],
            $params + $this->state->getId()
        );

        // Execute the before callback.
        if (is_callable($this->config["before_{$operation}"])) {
            $this->config["before_{$operation}"]($command);
        }

        // Execute the command asynchronously and return the promise.
        return $this->client->executeAsync($command);
    }
560886
public function execute(RiakOperation $operation)
    {
        if (empty($this->nodes)) {
            throw new RiakException('There are no nodes in the cluster.');
        }

        $size  = count($this->nodes);
        $index = mt_rand(0, $size - 1);
        $node  = $this->nodes[$index];

        return $node->execute($operation);
    }
56310
public function _performOperation($key, FieldOperation $operation)
    {
        $oldValue = null;
        if (isset($this->estimatedData[$key]))
        {
            $oldValue = $this->estimatedData[$key];
        }
        $newValue = $operation->_apply($oldValue, $this, $key);
        if ($newValue !== null)
        {
            $this->estimatedData[$key] = $newValue;
        } else if (isset($this->estimatedData[$key]))
        {
            unset($this->estimatedData[$key]);
        }

        if (isset($this->operationSet[$key]))
        {
            $oldOperations = $this->operationSet[$key];
            $newOperations = $operation->_mergeWithPrevious($oldOperations);
            $this->operationSet[$key] = $newOperations;
        } else
        {
            $this->operationSet[$key] = $operation;
        }
        $this->dataAvailability[$key] = true;
    }
820979
public static function ofSqlOperation($operation, $patchInsert = false) {
        if ($operation === SqlOperations::INSERT) return HttpMethods::POST;
        if ($operation === SqlOperations::SELECT) return HttpMethods::GET;
        if ($operation === SqlOperations::UPDATE) return $patchInsert ? HttpMethods::PATCH : HttpMethods::PUT;
        if ($operation === SqlOperations::DELETE) return HttpMethods::DELETE;

        return Exceptions::InvalidSqlOperationException($operation);
    }
1098576
private function getReason(OperationInterface $operation)
    {
        if (!$this->pool) {
            return null;
        }

        $reason = $operation->getReason();
        if ($reason instanceof Rule) {
            switch ($reason->getReason()) {
                case Rule::RULE_JOB_INSTALL:
                    return 'Required by the root package: ' . $reason->getPrettyString($this->pool);
                case Rule::RULE_PACKAGE_REQUIRES:
                    return $reason->getPrettyString($this->pool);
                default:
            }
        }

        return null;
    }
854855
public function addOperation(\CampaignChain\CoreBundle\Entity\Operation $operations)
    {
        $this->operations[] = $operations;

        return $this;
    }
730197
public function addOperation(Operation $operation)
    {
        $id = $operation->getMethod() . $operation->getPath();

        if ($operation->getOperation()->getOperationId()) {
            $id = $operation->getOperation()->getOperationId();
        }

        $this[$id] = $operation;

        return $this;
    }