A Fractal transformer.

@return array
357502
public function transform(Phone $phone)
    {
        return [
            'countryCode' => $phone->country_code,
            'id' => $phone->id,
            'label' => $phone->label,
            'phoneableId' => $phone->phoneable_id,
            'phoneableType' => $phone->phoneable_type,
            'phoneNumber' => $phone->phone_number,
        ];
    }
335234
public function getIterator()
    {
        $elements = new NodeList();
        if ($this->node->hasChildNodes()) {
            foreach ($this->node->childNodes as $node) {
                $elements[] = new Element($node);
            }
        }

        return $elements;
    }
24853
public function transform()
    {
        $originalData = $this->getData();
        $transformedData = $this->transformer->transform();

        $restData = $this->unsetKeys($originalData, $this->transformer->getSupportedKeys());
        $this->checkIfAllValuesWereProceeded($restData, $this->transformer);

        return $transformedData;
    }
1306336
public function getManipulators()
    {
        return [
            new Orientation(),
            new Crop(),
            new Size($this->getMaxImageSize()),
            new Brightness(),
            new Contrast(),
            new Gamma(),
            new Sharpen(),
            new Filter(),
            new Flip(),
            new Blur(),
            new Pixelate(),
            new Watermark($this->getWatermarks(), $this->getWatermarksPathPrefix()),
            new Background(),
            new Border(),
            new Encode(),
        ];
    }
33078
public function getFormatter()
    {
        if ($this->formatterInstance === null) {
            $this->formatterInstance = Yii::createObject(
                [
                    'class' => '\yii\i18n\Formatter',
                    'decimalSeparator' => $this->decimal_separator,
                    'thousandSeparator' => $this->thousand_separator,
                    'numberFormatterOptions' => [
                        \NumberFormatter::MIN_FRACTION_DIGITS => $this->min_fraction_digits,
                        \NumberFormatter::MAX_FRACTION_DIGITS => $this->max_fraction_digits,
                    ]
                ]
            );
        }
        return $this->formatterInstance;
    }
1208794
protected function generateTransformer()
    {
        $name = (string) $this->argument('name');
        $path = $this->laravel->basePath() . '/app/Transformers/' . $name . '.php';

        if ($this->files->exists($path)) {
            return $this->error($name . ' already exists!');
        }

        $this->makeDirectory($path);

        $stubPath = $this->option('pivot') ? 'resources/stubs/transformer.pivot.stub' : 'resources/stubs/transformer.stub';
        $stub = $this->files->get(__DIR__ . '/../../' . $stubPath);

        $this->files->put($path, $this->makeTransformer($name, $stub));

        $this->info('Transformer created successfully.');
    }
362312
public Transformer[] getDataProviderOutputTransformers() {
        Transformer[] transformers;

        if (dataProviderOutputTransformers == null) {
            transformers = null;
        } else {
            transformers = dataProviderOutputTransformers.toArray(new Transformer[dataProviderOutputTransformers.size
                    ()]);
        }

        return transformers;
    }
317564
protected function executeResourceTransformers()
    {
        $transformer = $this->resource->getTransformer();
        $data = $this->resource->getData();

        $transformedData = $includedData = [];

        if ($this->resource instanceof Item) {
            list($transformedData, $includedData[]) = $this->fireTransformer($transformer, $data);
        } elseif ($this->resource instanceof Collection) {
            foreach ($data as $value) {
                list($transformedData[], $includedData[]) = $this->fireTransformer($transformer, $value);
            }
        } elseif ($this->resource instanceof NullResource) {
            $transformedData = null;
            $includedData = [];
        } else {
            throw new InvalidArgumentException(
                'Argument $resource should be an instance of League\Fractal\Resource\Item'
                .' or League\Fractal\Resource\Collection'
            );
        }

        return [$transformedData, $includedData];
    }
133053
protected function getTransformer()
    {
        if (is_callable($this->transformer) || $this->transformer instanceof TransformerAbstract) {
            return $this->transformer;
        }

        return Craft::createObject($this->transformer);
    }
1112360
public function getModels()
	{
		$models=array();
		if($this->_model!==null)
			$models[]=$this->_model;
		foreach($this->getElements() as $element)
		{
			if($element instanceof self)
				$models=array_merge($models,$element->getModels());
		}
		return $models;
	}
52209
public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();
        $rule    = $builder->root('rule');
        {
            $rule->children()->variableNode('pattern')->isRequired();
            $rule->children()->variableNode('roles')->isRequired()->beforeNormalization()->ifString()->then(
                function ($v) {
                    return [$v];
                }
            )->end();
            $rule->children()->enumNode('channel')->values([null, 'http', 'https'])->defaultValue(null);

        }

        return $builder;
    }
46582
public function getIncludes(): array
    {
        if ($this->includes === null) {
            $this->includes = TransformerHelper::normalizeIncludes(
                $this->defineIncludes()
            );
        }

        return $this->includes;
    }
85209
protected function getPaymentTransactionStructure()
    {
        return [
            'reference_id' => $this->reference_id,
            'amount'       => $this->transformAmount($this->amount, $this->currency),
            'currency'     => $this->currency
        ];
    }
479738
private function _getTransforms(): array
    {
        if (!$this->availableTransforms) {
            return [];
        }

        $allTransforms = Craft::$app->getAssetTransforms()->getAllTransforms();
        $transformList = [];

        foreach ($allTransforms as $transform) {
            if (!is_array($this->availableTransforms) || in_array($transform->uid, $this->availableTransforms, false)) {
                $transformList[] = [
                    'handle' => Html::encode($transform->handle),
                    'name' => Html::encode($transform->name)
                ];
            }
        }

        return $transformList;
    }
1091612
public function toArray()
    {
        return [
            'name'     => $this->getName(),
            'label'    => $this->getLabel(),
            'width'    => $this->getWidth(),
            'fixed'    => $this->isFixed(),
            'minWidth' => $this->getMinWidth(),
            'sortable' => $this->getSortable(),
            'type'     => $this->getType(),
        ];
    }
225112
public function mutatorsToArray()
    {
        $mutatedAttributes = [];

        $mutators = $this->getMutatedAttributes();

        foreach ($mutators as $mutator) {
            $mutatedAttributes[Str::snake($mutator)] = $this->mutateAttribute($mutator);
        }

        return $mutatedAttributes;
    }
253425
protected function getBuilderParameters(): array
    {
        return [
            'dom' => $this->dom,
            'keys' => $this->keys,
            'order' => $this->order,
            'retrieve' => $this->retrieve,
            'autoWidth' => $this->autoWidth,
            'drawCallback' => "function (settings) {
                var api = this.api();

                $('#{$this->id} tbody td.dt-details-control').on('click', function () {
                    var tr = $(this).closest('tr');
                    var row = api.row(tr);

                    if (row.child.isShown()) {
                        row.child.hide();
                        tr.removeClass('shown');
                    } else {
                        row.child(dtFormatLogDetails(row.data().properties)).show();
                        tr.addClass('shown');
                    }
                });
            }",
            'buttons' => [
                'print', 'reset', 'reload', 'export',
                ['extend' => 'colvis', 'text' => '<i class="fa fa-columns"></i> '.trans('cortex/foundation::common.columns').' <span class="caret"/>'],
                ['extend' => 'pageLength', 'text' => '<i class="fa fa-list-ol"></i> '.trans('cortex/foundation::common.limit').' <span class="caret"/>'],
            ],
        ];
    }