Run to apply this definition

@param array $data data
@param FabricateContext $world fabricate context
@return array applied data
323862
public function run($data, $world)
    {
        $result = [];
        if (is_callable($this->define)) {
            $callback = $this->define;
            $result = $callback($data, $world);
        } elseif (is_array($this->define)) {
            $result = $this->define;
        }
        return $result;
    }
324610
public function build(array $data = [])
    {
        if(!$this->oAuth2Credential)
            $this->oAuth();

        $data = $this->mergeData($data);

        $adwordsSession = new AdWordsSessionBuilder();

        return $adwordsSession->withDeveloperToken($data['developerToken'])
                ->withClientCustomerId($data['clientCustomerId'])
                ->withOAuth2Credential($this->oAuth2Credential)
                ->build();
    }
287653
public function Run($data = null) {
        $FrameworkList = DirectoryManager::GetFilesNamesRecursively(
                        "APP_ROOT_DIR" . \Puzzlout\Framework\Enums\FrameworkFolderName::ViewsFolderName);
        $ApplicationList = DirectoryManager::GetFilesNamesRecursively(
                        "APP_ROOT_DIR" .
                        \Puzzlout\Framework\Enums\ApplicationFolderName::AppsFolderName .
                        "APP_NAME" .
                        \Puzzlout\Framework\Enums\ApplicationFolderName::ViewsFolderName);
        $this->InitGenerateFrameworkFile($FrameworkList);
        $this->InitGenerateApplicationFile($ApplicationList);
    }
233279
public static function setContextData(array $contextData = [])
    {
        $existContext = [];
        $coroutineId = self::getCoroutineId();
        if (isset(self::$context[$coroutineId][self::DATA_KEY])) {
            $existContext = self::$context[$coroutineId][self::DATA_KEY];
        }
        self::$context[$coroutineId][self::DATA_KEY] = ArrayHelper::merge($contextData, $existContext);
    }
572952
public function massFactory($data)
    {
        $results = [];
        foreach ($data as $post) {
            $results[] = $this->factory($post);
        }
        return $results;
    }
1256490
public function create(array $data)
    {
        $data = $this->client->post(Inflector::pluralize($this->getResourceName()), [$this->getResourceName() => $data]);

        return $this->fromArray(reset($data));
    }
776609
public function populate($data = array())
    {
        parent::populate($data);

        if (isset($data['scheduleOccurrenceAuto']) && $data['scheduleOccurrenceAuto'] !== null) {
            $this->scheduleOccurrenceAuto = $data['scheduleOccurrenceAuto'];
        }

        if (isset($data['occurrenceNumber']) && $data['occurrenceNumber'] !== null) {
            $this->occurrenceNumber = $data['occurrenceNumber'];
        }

        if (isset($data['winningOccurrenceNumber']) && $data['winningOccurrenceNumber'] !== null) {
            $this->occurrenceNumber = $data['winningOccurrenceNumber'];
        }

        if (isset($data['occurrenceType']) && $data['occurrenceType'] !== null) {
            $this->occurrenceType = $data['occurrenceType'];
        }
    }
1268853
public function createFromArrayWithContext($data, $options)
    {
        $_edgeClass = $this->_edgeClass;

        return $_edgeClass::createFromArray($data, $options);
    }
1347253
public function runAll($data = null, BaseObject $event = null) {
	    /** @var BaseScenario[] $filterCollection */
	    $filterCollection = $this->all();
        if(empty($filterCollection)) {
            return $data;
        }
        $event = !empty($event) ? $event : $this->event;
        foreach($filterCollection as $filterInstance) {
	        $data = $this->runOne($filterInstance, $data, $event);
        }
        return $data;
    }
675062
public function run($data)
    {
        $processId = $this->createProcessId();

        $GLOBALS['log']->debug('Installation process ['.$processId.']: start upload the package.');

        $this->initialize();

        $this->beforeRunAction();

        $packagePath = $this->getPackagePath();
        $packageArchivePath = $this->getPackagePath(true);

        if (!empty($data)) {
            list($prefix, $contents) = explode(',', $data);
            $contents = base64_decode($contents);
        }

        $res = $this->getFileManager()->putContents($packageArchivePath, $contents);
        if ($res === false) {
            throw new Error('Could not upload the package.');
        }

        $this->unzipArchive();

        $this->isAcceptable();

        $this->afterRunAction();

        $this->finalize();

        $GLOBALS['log']->debug('Installation process ['.$processId.']: end upload the package.');

        return $processId;
    }
956136
public static function setContextData(array $contextData = [])
    {
        $coroutineId = self::getcoroutine();
        self::$coroutineLocal[$coroutineId][self::COROUTINE_DATA] = $contextData;
    }
1173851
public static function decode($data, array $context = [])
    {
        $context = array_merge(static::$defaultDecodeContext, $context);

        return static::decodeData($data, $context);
    }
703305
public function validate($context = 'default', array $data = [])
    {
        if (!empty($data)) {
            $this->setData($data);
        }

        $this->setContext($context);
        $rules = $this->buildRulesArray();
        $validator = $this->factory->make($this->filterArray($rules, $this->data), $rules);
        if ($validator->passes()) {
            return $validator->getData();
        }
        throw new ValidationException($validator);
    }
358159
public function loadArguments($data, callable $callable, Context $context): array
    {
        if (is_object($data) && $data instanceof \stdClass) {
            $data = get_object_vars($data);
        }

        if (!is_array($data)) {
            throw new InvalidDataException('Argument data must array or stdClass');
        }

        $metadata = $this->callableMetadataProvider->getCallableMetadata($callable);

        $args = [];
        $paramPos = 0;
        $argPos = 0;
        while ($paramPos < count($metadata->parameters)) {
            $param = $metadata->parameters[$paramPos];
            $mangledName = $this->nameMangler->mangle($param->name);

            $key = null;
            if (array_key_exists($argPos, $data)) {
                $key = $argPos;
            } elseif (array_key_exists($mangledName, $data)) {
                $key = $mangledName;
            }

            if ($key !== null) {
                $context->pushPath('$' . $key);
                try {
                    $args[] = $this->loader->load($data[$key], $param->type, $context);
                } finally {
                    unset($data[$key]);
                    $context->popPath();
                }
            } elseif ($param->optional) {
                if ($param->variadic) {
                    break;
                }
                $args[] = $param->defaultValue;
            } else {
                throw new InvalidDataException("Required argument $param->name missing");
            }

            $argPos++;
            if (!$param->variadic) {
                $paramPos++;
            }
        }

        if (!empty($data) && $this->throwOnUnknownArgument) {
            throw new InvalidDataException(
                'Some arguments could not be matched: ' . implode(', ', array_keys($data))
            );
        }

        return $args;
    }
635918
protected function createReceiveTextMsg(array $data)
    {
        $result = new WxReceiveTextMsg();
        $this->initReceiveMsg($result, $data);
        if (isset($data['Content'])) {
            if (!is_string($data['Content'])) {
                Helper::getLogWriter()->debug("[createReceiveTextMsg]" . serialize($data));
                $data['Content'] = '';
            }
        }

        $result->setContent(isset($data['Content']) ? trim($data['Content']) : '');
        return $result;
    }
424883
private function build(array $data)
    {
        $children = array();

        // Create the root node
        $this->nodes[$this->options['rootid']] = $this->createNode(
            array(
                'id'     => $this->options['rootid'],
                'parent' => null,
            )
        );

        foreach ($data as $row) {
            $this->nodes[$row['id']] = $this->createNode($row);
            if (empty($children[$row['parent']])) {
                $children[$row['parent']] = array($row['id']);
            } else {
                $children[$row['parent']][] = $row['id'];
            }
        }

        foreach ($children as $pid => $childids) {
            foreach ($childids as $id) {
                if ($pid == $id) {
                    throw new InvalidParentException(
                        "Node with ID $id references its own ID as parent ID"
                    );
                }
                if (isset($this->nodes[$pid])) {
                    $this->nodes[$pid]->addChild($this->nodes[$id]);
                } else {
                    throw new InvalidParentException(
                        "Node with ID $id points to non-existent parent with ID $pid"
                    );
                }
            }
        }
    }
653902
public function createActions(array $data): array
    {
        return array_map(function ($data) {
            if ($data instanceof RuleAction) {
                return $data;
            }

            return RuleAction::createFromData((array) $data);
        }, $data);
    }