Run data transformation.

@param  mixed  $data

@return array|mixed
776691
public function run($data)
    {
        if (($data instanceof Eloquent) || ($data instanceof Arrayable)) {
            return $data->toArray();
        } elseif ($data instanceof Renderable) {
            return \e($data->render());
        } elseif (\is_array($data)) {
            return \array_map([$this, 'run'], $data);
        }

        return $data;
    }
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;
    }
215152
public static function run($definition, $data) {
		$definition = Helper::isEnabledComponent($definition);
		if(!$definition) {
			return $data;
		}
		$object = self::create($definition);
		if(method_exists($object, 'isEnabled') && !$object->isEnabled()) {
			return $data;
		}
		$data = $object->run($data);
		return $data;
	}
52910
protected function convert($data)
    {
        foreach ($data[0] as $key => $value) {
            if (!$this->_kept && !$this->_stashed) {
                $this->$key = $value;
                $this->setKey($key, $value);
            } else {
                if ($this->_kept) {
                    $this->_keptData[$key] = $value;
                }
                if ($this->_stashed) {
                    $this->_stashedData[$key] = $value;
                }
            }

            $this->data[$key] = $value;
        }
    }
384311
protected function transform($data)
    {
        $items = $data->get('@attributes', [])->toArray();
        if ( isset($items[ 'line' ]) ) {
            $items[ 'line' ] = (int)$items[ 'line' ];
        }
        return $items;
    }
83608
public function takeData($data)
    {
        $keyColumn = $this->getKeyColumn();
        if (array_key_exists($keyColumn, $data) && is_array($data[$keyColumn])) {
            foreach ($data[$keyColumn] as $recPos => $recordKey) {
                if (substr($recordKey, 0, 4) == 'ext:') {
                    $data['external-ids'][] = $recordKey;
                    unset($data[$keyColumn][$recPos]);
                }
            }
            if (count($data[$keyColumn]) == 1) {
                $data[$keyColumn] = current($data[$keyColumn]);
            }
        }
        $result = parent::takeData($data);

        if (array_key_exists($keyColumn, $data) || array_key_exists('kod', $data)) {
            $this->updateApiURL();
        }

        return $result;
    }
920743
protected function mapData($data)
    {
        $values = array();

        foreach ($data->buckets as $bucket) {
            $values[$bucket->key] = $bucket->doc_count;
        }

        return $values;
    }
1027031
public function remove($data)
    {
        if (is_array($data)) {
            foreach ($data as $entity) {
                $this
                    ->manager
                    ->remove($entity);
            }
        } else {
            $this
                ->manager
                ->remove($data);
        }

        $this
            ->manager
            ->flush($data);

        return $data;
    }
549207
public function transform($data)
    {
        if (is_null($data) || '' === $data) {
            return '';
        }

        if (! is_numeric($data)) {
            throw new DataTransformerException('A numeric value is expected.');
        }

        $formatter = $this->getFormatter();

        $value =  $formatter->format($data);

        if (intl_is_failure($formatter->getErrorCode())) {
            throw new DataTransformerException($formatter->getErrorMessage());
        }

        // Convert fixed spaces to normal ones
        return str_replace("\xc2\xa0", ' ', $value);
    }
1295999
protected function getFields($data)
    {
        if (is_array($data)) {
            $fields = $data;
        } else {
            $this->checkData($data);
            $fields = $data->fields();
        }

        return $fields;
    }
364457
public function Run($data = null) {
        $this->ProcessFrameworkData();

        $ApplicationList = \Puzzlout\Framework\GeneratorEngine\Constants\ApplicationList::Init()->GetList();
        foreach ($ApplicationList as $Appname) {
            $this->ProcessApplicationData($Appname);
        }
    }
1182029
protected function convertValue($data)
    {
        if ($this->isTraversable($data)) {
            return $this->recursiveConvertArray($data);
        }

        if (is_object($data)) {
            return $this->convertObject($data) ?: null;
        }

        return $data;
    }
729481
public function transform($data)
    {
        if ($data instanceof FormBuilder) {
            $response = $data->getRawResponse();

            foreach ($response['fieldsets'] as $fieldset) {
                $this->transformFieldset($fieldset);
            }

            return [
                'form' => [
                    'name'      => array_get($response, 'name'),
                    'rules'     => array_get($response, 'rules', []),
                    'fieldsets' => $this->fieldsets,
                ],
            ];
        }

        return parent::transform($data);
    }
1125366
public static function fromData(array $data)
    {
        $reflection = new \ReflectionClass(static::class);
        $instance = $reflection->newInstanceWithoutConstructor();
        $instance->data = $data;
        $instance->jsonUnserialize($data);
        return $instance;
    }
507255
public function create_data( $data = [] ) {
		if ( is_object( $data ) && method_exists( $data, 'to_array' )  ) {
			return $data->to_array();
		}

		return is_array( $data ) ? $data : [];
	}
633381
private function denormalizeData($data)
    {
        if (is_scalar($data) || $data === null) {
            return $data;
        }

        if (isset($data[$this->classAnnotation])) {
            return $this->denormalizeObject($data);
        }

        return array_map([$this, 'denormalizeData'], $data);
    }
650750
static public function toObject($data)
    {
        if (is_object($data)) {
            return $data;
        }
        if (is_array($data)) {
            $data = json_encode($data);
        }
        return json_decode($json);
    }