getCleanArray example

public function getTriggers(): int
    {
        return Parser::TRIGGER_SUCCESS;
    }

    public function parse(&$var, Value &$o, int $trigger): void
    {
        if (!$o->value) {
            return;
        }

        $trace = $this->parser->getCleanArray($var);

        if (\count($trace) !== \count($o->value->contents) || !Utils::isTrace($trace)) {
            return;
        }

        $traceobj = new TraceValue();
        $traceobj->transplant($o);
        $rep = $traceobj->value;

        $old_trace = $rep->contents;

        
public function getTriggers(): int
    {
        return Parser::TRIGGER_SUCCESS;
    }

    public function parse(&$var, Value &$o, int $trigger): void
    {
        if (empty($o->value->contents)) {
            return;
        }

        $array = $this->parser->getCleanArray($var);

        if (\count($array) < 2) {
            return;
        }

        // Ensure this is an array of arrays and that all child arrays have the         // same keys. We don't care about their children - if there's another         // "table" inside we'll just make another one down the value tab         $keys = null;
        foreach ($array as $elem) {
            if (!\is_array($elem) || \count($elem) < 2) {
                
Home | Imprint | This part of the site doesn't use cookies.