picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 616 forks source link

php - error Unparenthesized issue in node.php #607

Closed hemroy21 closed 2 years ago

hemroy21 commented 2 years ago

Hello devs for Pico, today while installing the Pico, I got the php - error Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or `a ? b : (c ? d : e) in vendor\twig\twig\lib\Twig\Node.php at line no, 42 and 198.

at line no 42 I had seen the issue,

if (!$node instanceof Twig_NodeInterface) {
                @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', is_object($node) ? get_class($node) : null === $node ? 'null' : gettype($node), $name, get_class($this)), E_USER_DEPRECATED);
            }

Which I solved it, as below,

if (!$node instanceof Twig_NodeInterface) {
                @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', is_object($node) ? get_class($node) : (null === $node ? 'null' : gettype($node)), $name, get_class($this)), E_USER_DEPRECATED);
            }

The same parenthesizing pattern I followed in the Line no 198 to work Pico perfectly.

Thank you. image

PhrozenByte commented 2 years ago

Duplicate of #584

You can give Pico v3.0.0-alpha.2 a try. Even though it's marked as pre-release, it's actually as stable as Pico v2. The only difference are updated dependencies.