Processes the expectation.

@return mixed
5813
protected function _processDelegated()
    {
        $exception = null;

        try {
            call_user_func($this->_handler);
        } catch (Throwable $e) {
            $exception = $e;
        } catch (Exception $e) {
            $exception = $e;
        }

        if (!$exception) {
            $this->_logs[] = ['type' => 'passed'];
            $this->_passed = true;
            return $this;
        }

        $this->_passed = false;

        if (!$exception instanceof $this->_type) {
            throw $exception;
        }

        $this->_logs[] = [
            'type' => 'failed',
            'data' => [
                'external' => true,
                'description' => $exception->getMessage()
            ],
            'backtrace' => Debugger::normalize($exception->getTrace())
        ];
        return $this;
    }
1274427
public function getStrategyForExpectation(Expectation $expectation)
    {
        if (!empty($expectation->getProxyTo())) {
            return $this->diService->get(ProxyResponseStrategy::class);
        }
        if ($this->requestBodyOrUrlAreRegexp($expectation)) {
            return $this->diService->get(RegexResponseStrategy::class);
        }

        return $this->diService->get(HttpResponseStrategy::class);
    }
752953
public function process()
	{
		$view = $this->getView();

		try
		{
			$context = $this->getContext();
			$basketCtrl = \Aimeos\Controller\Frontend::create( $context, 'basket' );
			$servCtrl = \Aimeos\Controller\Frontend::create( $context, 'service' )->uses( ['media', 'price', 'text'] );

			// only start if there's something to do
			if( ( $serviceIds = $view->param( 'c_paymentoption', null ) ) !== null )
			{
				$basketCtrl->deleteService( 'payment' );

				foreach( (array) $serviceIds as $id )
				{
					try
					{
						$basketCtrl->addService( $servCtrl->get( $id ), $view->param( 'c_payment/' . $id, [] ) );
					}
					catch( \Aimeos\Controller\Frontend\Basket\Exception $e )
					{
						$view->deliveryError = $e->getErrors();
						$view->standardErrorList = $view->get( 'standardErrorList', [] ) + $e->getErrors();

						throw $e;
					}
				}
			}


			parent::process();


			// Test if payment service is available
			$services = $basketCtrl->get()->getServices( 'payment' );

			if( !isset( $view->standardStepActive ) && empty( $services['payment'] )
				&& count( $servCtrl->getProviders( 'payment' ) ) > 0
			) {
				$view->standardStepActive = 'payment';
				return false;
			}
		}
		catch( \Exception $e )
		{
			$view->standardStepActive = 'payment';
			throw $e;
		}
	}
690857
public function process()
    {
        $operands = $this->getOperands();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->exclusivelyMultipleOrOrdered() === false) {
            $msg = "The Random operator only accepts values with multiple or ordered cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        $operand = $operands[0];
        $maxIndex = count($operand) - 1;

        return $operand[mt_rand(0, $maxIndex)];
    }
357767
public function process() {
		$remainingChildren = $this->remainingChildren;

		if (!count($remainingChildren)) {
			$this->isComplete = true;
			return;
		}

		$this->currentStep++;

		// lets process our first item
		$pair = array_shift($remainingChildren);
		$sourceObject = ExternalContent::getDataObjectFor($pair->sourceID);
		if (!$sourceObject) {
			$this->addMessage("Missing source object for " . $pair->sourceID, 'WARNING');
			$this->remainingChildren = $remainingChildren;
			return;
		}

		$targetObject = DataObject::get_by_id($pair->targetType, $pair->targetID);
		if (!$targetObject) {
			$this->addMessage("Missing target object for $pair->targetType $pair->sourceID", 'WARNING');
			$this->remainingChildren = $remainingChildren;
			return;
		}

		// lets do a single import first, then check the children and append them
		$pageType = $this->getExternalType($sourceObject);
		if (isset($this->contentTransforms[$pageType])) {
			$transformer = $this->contentTransforms[$pageType];

			$result = $transformer->transform($sourceObject, $targetObject, $this->duplicateStrategy);

			// if there's more, then transform them
			if ($this->includeChildren && $result && $result->children && count($result->children)) {
				foreach ($result->children as $child) {
					$remainingChildren[] = new EC_SourceTarget($child->ID, $result->page->ID, $result->page->ClassName);
					$this->totalSteps++;
				}
			}
		}

		$this->remainingChildren = $remainingChildren;

		if (!count($remainingChildren)) {
			$this->isComplete = true;
			return;
		}
	}
898026
public function process()
    {
        $entityDefs = $this->getEntityDefs(true);

        $ormMetadata = array();
        foreach($entityDefs as $entityName => $entityMetadata) {

            if (empty($entityMetadata)) {
                $GLOBALS['log']->critical('Orm\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format');
                continue;
            }

            $ormMetadata = Util::merge($ormMetadata, $this->convertEntity($entityName, $entityMetadata));
        }

        $ormMetadata = $this->afterProcess($ormMetadata);

        return $ormMetadata;
    }
287223
public function process()
    {
        $testSession = $this->getState();
        $itemSubset = $this->getItemSubset();
        $numberSelected = 0;

        foreach ($itemSubset as $item) {
            $itemSessions = $testSession->getAssessmentItemSessions($item->getIdentifier());
            
            if ($itemSessions !== false) {
                foreach ($itemSessions as $itemSession) {
                    if ($itemSession->isSelected() === true) {
                        $numberSelected++;
                    }
                }    
            }
        }

        return new QtiInteger($numberSelected);
    }
1297425
public function process()
    {
        $expr = $this->getExpression();
        if ($expr->getName() === MathEnumeration::E) {
            return new QtiFloat(M_E);
        } else {
            return new QtiFloat(M_PI);
        }
    }
1098574
public function process()
    {

        // Initialize the query library we are using
        $class = new \ReflectionClass($this->queryLibrary);

        // Set the query pointer to the new instance of the library
        $this->query = $class->newInstance();

        unset($class);

        // Define the return
        $results = [];

        // @todo: Add break up into loop to split large arrays into smaller chunks

        // Do server challenge(s) first, if any
        $this->doChallenges();

        // Do packets for server(s) and get query responses
        $this->doQueries();

        // Now we should have some information to process for each server
        foreach ($this->servers as $server) {
            /* @var $server \GameQ\Server */

            // Parse the responses for this server
            $result = $this->doParseResponse($server);

            // Apply the filters
            $result = array_merge($result, $this->doApplyFilters($result, $server));

            // Sort the keys so they are alphabetical and nicer to look at
            ksort($result);

            // Add the result to the results array
            $results[$server->id()] = $result;
        }

        return $results;
    }
1229275
protected function processChecksum() {
        if ($this->checksumValue === false) { // Calculate the checksum only once
            $this->calculateChecksum();
        }

        if ($this->checksumValue !== false) {
            $ret = '';
            $c = count($this->checksumValue);
            for ($i = 0; $i < $c; $i++) {
                $ret .= $this->keys[$this->checksumValue[$i]];
            }

            return $ret;
        }

        return false;
    }
829706
protected function _process()
    {
        if (is_callable($this->_handler)) {
            return $this->_processDelegated();
        }
        $spec = $this->_actual;

        if (!$spec instanceof Specification || $spec->passed() !== null) {
            return $this;
        }

        $closure = function () use ($spec) {
            $spec->reset();
            $spec->process($result);
            $this->_logs = $spec->logs();
            return $this->_passed = $spec->passed();
        };

        try {
            $this->_spin($closure);
        } catch (TimeoutException $e) {
        }
        if ($exception = $spec->log()->exception()) {
            throw $exception;
        }

        $this->_passed = $spec->passed() && ($this->_passed === null ? true : $this->_passed);
        return $this;
    }
1166875
public function process ()
    {
        if ($this->isProcessed)
            return;
        $this->isProcessed = true;
        foreach ($this->getFields() as $field)
            /* @var $field Field */
            $field->preprocess();
        $this->isUserSubmitted = $this->getValue($this->getSubmitConfirmFieldName(), 'false') == 'true' || $this->forceSubmit;
        if ($this->isUserSubmitted) {
            foreach ($this->getFields() as $field)
                $field->restoreValue($this->method);

            $this->activateHandlers();

            if ($this->isValid()) {
                $this->submit();
            }
        }
    }
731027
public function process()
    {
        $data = &$this->getForm()->getFormData();

        if (!isset($data[$this->id])) {
            $this->value = null;
        } elseif ($data[$this->id] == '') {
            $this->value = null;
        } else {
            $this->value = $data[$this->id];
        }

        $this->values = $this->splitValues($this->value);
        $locale = SwatI18NLocale::get();

        if (!$this->required && count($this->values) === 0) {
            return;
        } elseif (
            $this->max_entries > 0 &&
            count($this->values) > $this->max_entries
        ) {
            $message = sprintf(
                Swat::_('The %%s field cannot have more than %s entries.'),
                $locale->formatNumber($this->max_entries)
            );

            $this->addMessage(new SwatMessage($message, 'error'));
        } elseif (
            $this->required &&
            count($this->values) < $this->min_entries
        ) {
            $message = sprintf(
                Swat::ngettext(
                    'The %%s field must have at least %s entry.',
                    'The %%s field must have at least %s entries.',
                    $this->min_entries
                ),
                $locale->formatNumber($this->min_entries)
            );

            $this->addMessage(new SwatMessage($message, 'error'));
        }

        // validate individual values

        $min_length_msg = null;
        $max_length_msg = null;
        $min_length_error_values = array();
        $max_length_error_values = array();

        foreach ($this->values as $value) {
            $len = mb_strlen($value);
            if ($this->maxlength !== null && $len > $this->maxlength) {
                $max_length_msg =
                    sprintf(
                        Swat::ngettext(
                            'Entries in the %%s field must be less than %s ' .
                                'character long.',
                            'Entries in the %%s field must be less than %s ' .
                                'characters long.',
                            $this->maxlength
                        ),
                        $locale->formatNumber($this->maxlength)
                    ) . ' ';

                $max_length_error_values[] = $value;
            } elseif ($this->minlength !== null && $len < $this->minlength) {
                $min_length_msg =
                    sprintf(
                        Swat::ngettext(
                            'Entries in the %%s field must be at least %s ' .
                                'character long.',
                            'Entries in the %%s field must be at least %s ' .
                                'characters long.',
                            $this->minlength
                        ),
                        $locale->formatNumber($this->minlength)
                    ) . ' ';

                $min_length_error_values[] = $value;
            }
        }

        if ($min_length_msg !== null) {
            $min_length_msg .= sprintf(
                Swat::ngettext(
                    'The following entry is too short: %s.',
                    'The following entries are too short: %s.',
                    count($min_length_error_values)
                ),
                implode(', ', $min_length_error_values),
                $locale->formatNumber(count($min_length_error_values))
            );

            $this->addMessage(new SwatMessage($min_length_msg, 'error'));
        }

        if ($max_length_msg !== null) {
            $max_length_msg .= sprintf(
                Swat::ngettext(
                    'The following entry is too long: %s.',
                    'The following entries are too long: %s.',
                    count($max_length_error_values)
                ),
                implode(', ', $max_length_error_values),
                $locale->formatNumber(count($max_length_error_values))
            );

            $this->addMessage(new SwatMessage($max_length_msg, 'error'));
        }
    }
186789
public function process()
    {
        if ($this->cache !== null) {
            return $this->cache;
        } else {
            return ($this->cache = UriTemplate::expand($this->template, $this->data));
        }
    }
691912
public function process()
    {
        $value = $this->value();
        if (!is_scalar($value) || $value === '') {
            return false;
        }

        $bool = (bool)$value;

        $nullValue = $this->getConfig('nullValue');
        $comparison = ' !=';
        if (!$bool) {
            $comparison = '';
        }
        if ($nullValue === null) {
            $comparison = ' IS NOT';
            if (!$bool) {
                $comparison = ' IS';
            }
        }

        if (!$this->manager()->getRepository() instanceof Table) {
            foreach ($this->fields() as $field) {
                $this->getQuery()->where([
                    $field . $comparison => $nullValue,
                ]);
            }

            return true;
        }

        $conditions = [];
        foreach ($this->fields() as $field) {
            $conditions[] = [$field . $comparison => $nullValue];
        }

        $this->getQuery()->andWhere([$this->getConfig('mode') => $conditions]);

        return true;
    }
962569
protected function process()
    {

        // initialize the store view code
        $this->getSubject()->prepareStoreViewCode();

        // load the PK
        $pk = $this->getValue($this->getPrimaryKeyColumnName());

        // load the store view - if no store view has been set, we assume the admin
        // store view, which will contain the default (fallback) attribute values
        $storeViewCode = $this->getSubject()->getStoreViewCode(StoreViewCodes::ADMIN);

        // query whether or not the row has already been processed
        if ($this->storeViewHasBeenProcessed($pk, $storeViewCode)) {
            // log a message
            $this->getSystemLogger()->warning(
                $this->getSubject()->appendExceptionSuffix(
                    sprintf(
                        'Attributes for %s "%s" + store view code "%s" has already been processed',
                        $this->getPrimaryKeyColumnName(),
                        $pk,
                        $storeViewCode
                    )
                )
            );

            // return immediately
            return;
        }

        // load the store ID, use the admin store if NO store view code has been set
        $storeId = $this->getSubject()->getRowStoreId(StoreViewCodes::ADMIN);

        // load the image attribute
        $attribute = $this->getEavAttributeByAttributeCode('image');

        // remove the image if one exists
        if ($value = $this->loadVarcharAttribute($pk, $attribute[MemberNames::ATTRIBUTE_ID], $storeId)) {
            $this->deleteVarcharAttribute(array(MemberNames::VALUE_ID => $value[MemberNames::VALUE_ID]));
        }
    }
438367
protected function process()
    {
        extract($this->compileExpression());

        $this->clean();
        $this->resolver->close();

        $this->resolver->setParameter($params);
        $this->resolver->setSource($source);
        $this->resolver->setFilter($filter);

        if ($image = $this->resolver->getCached()) {
            $src = $this->base.$this->resolver->getCachedUrl($image);

            $extension = $image->getSourceFormat(true);
            $this->resolver->close();
            $image->close();

            return $src.'.'.$extension;
        }

        if ($image = $this->resolver->resolve($image)) {
            $src = $this->resolver->getImageUrl($image);
            $this->resolver->close();
            $image->close();

            return $src;
        }

        $this->resolver->close();

        return;
    }