Get normalized array trace.

@return array
182881
public function getNormalized(\Exception $exception)
    {
        $stack = $exception->getTrace();
        $trace = [];

        foreach ($stack as $item) {
            $trace[] = [
                'invocation' => $this->getInvocation($item),
                'origin'     => $this->getOrigin($item)
            ];
        }

        return $trace;
    }
186779
public function trace() {
        $tracingLinks = array_merge(
            $this->getGeneratorElements("trace"),
            $this->getAllGenerators()["runtime"]->traceRuntimeCalls($this->generateFiles(), $this->productLine)
        );
        $tracingLinks = fphp\Helper\_Array::sortByKey($tracingLinks, "getFeatureName");
        return $tracingLinks;
    }
628883
public function getTraceSaveAsString()
    {
        $traces   = $this->getTrace();
        $messages = ['STACK TRACE DETAILS : '];

        foreach ($traces as $index => $trace) {
            $message = sprintf('#%d ', $index + 1);

            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($trace['file'])) {
                if (!is_string($trace['file'])) {
                    $message .= '[Unknown Function]: ';
                } else {
                    $line = 0;

                    /** @noinspection UnSafeIsSetOverArrayInspection */
                    if (isset($trace['line']) && is_int($trace['line'])) {
                        $line = $trace['line'];
                    }

                    $message .= sprintf('%s(%d): ', $trace['file'], $line);
                }
            } else {
                $message .= '[Internal Function]: ';
            }

            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($trace['class']) && is_string($trace['class'])) {
                $message .= $trace['class'] . ' ';
            }

            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($trace['type']) && is_string($trace['type'])) {
                $message .= $trace['type'] . ' ';
            }

            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($trace['function']) && is_string($trace['function'])) {
                $message .= $trace['function'] . '(';

                /** @noinspection UnSafeIsSetOverArrayInspection */
                if (isset($trace['args']) && count($trace['args']) > 0) {
                    /** @var array $arguments */
                    $arguments    = $trace['args'];
                    $argVariables = [];

                    foreach ($arguments as $argument) {
                        $argVariables[] = $this->switchType($argument);
                    }

                    $message .= implode(', ', $argVariables);
                }

                $message .= ')';
            }

            $messages[] = trim($message);
        }

        return implode("\n", $messages);
    }
694601
public function getCoveredLines(): array
    {
        $this->getDiff();

        $coveredFiles = $this->fileChecker->parseLines();
        $this->uncoveredLines = [];
        $this->coveredLines = [];

        $diffFiles = array_keys($this->cache->diff);
        foreach ($diffFiles as $file) {
            $matchedFile = $this->findFile($file, $coveredFiles);
            if ($matchedFile !== '') {
                $this->matchLines($file, $matchedFile);
            }
        }

        return [
            'uncoveredLines' => $this->uncoveredLines,
            'coveredLines' => $this->coveredLines,
        ];
    }
112795
public function getStack() {
        $stack = array();

        $preMicroTime = NULL;
        foreach ($this->timeline as $index => $item) {
            if ($preMicroTime === NULL) {
                $preMicroTime = $item['time'];
            }
            $internalTime = $item['time'] - $preMicroTime;
            $internalTime = round($internalTime/10, 1);

            $stack[] = sprintf('[#%d - %sms%s]%s(%d)',
                $index, 
                $internalTime, 
                $item['tag'] !== NULL ? ' - ' . $item['tag'] : '', 
                $item['file'], 
                $item['line']
            );
        }

        return $stack;
    }
1246043
public function toMappedArray()
    {
        $values = $this->toArray();
        $mappedValues = [];
        foreach ($values as $key => $value) {
            $mappedValues[$key] = $this->readMapped($key);
        }

        return $mappedValues;
    }
891563
public static function toArray()
    {
        $class = get_called_class();
        if (!array_key_exists($class, self::$cache)) {
            $reflection          = new \ReflectionClass($class);
            self::$cache[$class] = $reflection->getConstants();
        }

        return self::$cache[$class];
    }
1316855
public function parse(array $trace)
    {
        $this->trace = &$trace;
        $traceCount = count($trace);
        
        for($this->eachIndex = $traceCount - 1; $this->eachIndex >= 0; --$this->eachIndex)
        {
            $traceLine = $trace[$this->eachIndex];
            if($this->isFindingBeanRealCall)
            {
                if($this->isKeep($traceLine))
                {
                    $this->isFindingBeanRealCall = false;
                }
                else
                {
                    unset($trace[$this->eachIndex]);
                }
            }
            else
            {
                if(isset($traceLine['class']))
                {
                    $ref = new \ReflectionClass($traceLine['class']);
                    if($ref->implementsInterface(IBean::class))
                    {
                        $this->beanRealCallRealClassName = $this->getBeanRealCallRealClassName();
                        if(null === $this->beanRealCallRealClassName)
                        {
                            continue;
                        }
                        $this->isFindingBeanRealCall = true;
                        unset($trace[$this->eachIndex]);
                        --$this->eachIndex;
                        unset($trace[$this->eachIndex]);
                    }
                }
            }
        }
        return array_values($trace);
    }
173996
protected function listTraits()
    {
        $result = [];

        $classes = array_reverse(class_parents(static::class)) + [static::class];
        foreach ($classes as $class) {
            $result += trait_uses_recursive($class);
        }

        return array_unique($result);
    }
491430
public function toArray()
    {
        return [
            'balance' => $this->balance,
            'connection' => $this->connection,
            'queue' => $this->queue,
            'delay' => $this->delay,
            'force' => $this->force,
            'maxProcesses' => $this->maxProcesses,
            'minProcesses' => $this->minProcesses,
            'maxTries' => $this->maxTries,
            'memory' => $this->memory,
            'nice' => $this->nice,
            'name' => $this->name,
            'sleep' => $this->sleep,
            'timeout' => $this->timeout,
        ];
    }
181115
public function toNestedArray()
    {
        $result = [];

        foreach ($this->items as $item) {
            if (is_object($item)) {
                if (method_exists($item, 'toMap')) {
                    $result[] = $item->toMap();
                } else {
                    $result[] = (array) $item;
                }
            } else {
                $result[] = $item;
            }
        }

        return $result;
    }
1075151
public function trace()
    {
        $s = 0;
        $n = min($this->m, $this->n);
        for ($i = 0; $i < $n; ++$i) {
            $s += $this->A[$i][$i];
        }
        return $s;
    }
213021
protected function _getReferenceMapNormalized()
    {
        $referenceMapNormalized = array();

        foreach ($this->_referenceMap as $rule => $map) {

            $referenceMapNormalized[$rule] = array();

            foreach ($map as $key => $value) {
                switch ($key) {

                    // normalize COLUMNS and REF_COLUMNS to arrays
                    case self::COLUMNS:
                    case self::REF_COLUMNS:
                        if (!is_array($value)) {
                            $referenceMapNormalized[$rule][$key] = array($value);
                        } else {
                            $referenceMapNormalized[$rule][$key] = $value;
                        }
                        break;

                    // other values are copied as-is
                    default:
                        $referenceMapNormalized[$rule][$key] = $value;
                        break;
                }
            }
        }

        return $referenceMapNormalized;
    }
83235
private function buildTrace($exception)
    {
        $_trace = [];
        foreach ($exception->getTrace() as $key => $item) {
            $_trace[$key] = [
                'file' => isset($item['file']) ? $item['file'] : null,
                'line' => isset($item['line']) ? $item['line'] : null,
                'function' => isset($item['function']) ? $item['function'] : null,
                'class' => isset($item['class']) ? $item['class'] : null,
            ];
        }
        
        return $_trace;
    }
272273
public function toArray()
    {
        return [
            'Logging' => !empty($this->_logging) ? $this->_logging->toArray() : null,
            'Metrics' => !empty($this->_metrics) ? $this->_metrics->toArray() : null,
        ];
    }
1193811
protected function getBacktrace() {
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);

            if (empty($trace)) {
                // @codeCoverageIgnoreStart
                return [];
                // @codeCoverageIgnoreEnd
            } else {
                foreach ($trace as $k => $v) {
                    foreach (self::$ignoredFiles as $i) {
                        if (stripos(Alo::ifnull($v['file'], ''), $i) !== false) {
                            unset($trace[$k]);
                            break;
                        }
                    }
                }
            }

            return array_values($trace);
        }
900734
protected function normalizeDirArray()
    {
        if (!isset($this->dir['iterate'])) {
            $this->dir['iterate'] = self::DEFAULT_ITERATE;
        }
        if (!isset($this->dir['path'])) {
            $this->dir['path'] = self::DEFAULT_PATH;
        }
        if (!isset($this->dir['recursive'])) {
            $this->dir['recursive'] = self::DEFAULT_RECURSIVE;
        }
    }