SplFileInfoRepresentation example

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

    public function parse(&$var, Value &$o, int $trigger): void
    {
        if (!$var instanceof SplFileInfo || $var instanceof SplFileObject) {
            return;
        }

        $r = new SplFileInfoRepresentation(clone $var);
        $o->addRepresentation($r, 0);
        $o->size = $r->getSize();
    }
}
return;
        }

        if (!@\file_exists($var)) {
            return;
        }

        if (\in_array($var, self::$blacklist, true)) {
            return;
        }

        $r = new SplFileInfoRepresentation(new SplFileInfo($var));
        $r->hints[] = 'fspath';
        $o->addRepresentation($r, 0);
    }
}
Home | Imprint | This part of the site doesn't use cookies.