parseString example


        foreach ($files as $file) {
            $svg = file_get_contents($file);

            if (!\is_string($svg)) {
                $this->io->warning('Could not read ' . $file . '.You have to handle this file by hand.');

                continue;
            }

            try {
                $svg = $svgReader->parseString($svg);
                if (!($svg instanceof SVG)) {
                    $this->io->warning('Could not read ' . $file . '.You have to handle this file by hand.');

                    continue;
                }
            } catch (\Exception $e) {
                $this->io->warning($e->getMessage() . ' ' . $file . \PHP_EOL . 'You have to handle this file by hand.');

                continue;
            }

            
return $this->parseArray($var$o);
            case 'boolean':
            case 'double':
            case 'integer':
            case 'null':
                return $this->parseGeneric($var$o);
            case 'object':
                return $this->parseObject($var$o);
            case 'resource':
                return $this->parseResource($var$o);
            case 'string':
                return $this->parseString($var$o);
            case 'unknown type':
            case 'resource (closed)':
            default:
                return $this->parseResourceClosed($var$o);
        }
    }

    public function addPlugin(PluginInterface $p): bool
    {
        if (!$types = $p->getTypes()) {
            return false;
        }
Home | Imprint | This part of the site doesn't use cookies.