芝麻web文件管理V1.00
编辑当前文件:/home/rejoandoctor/test.joruridoctor.com/vendor/psy/psysh/src/CodeCleaner/StrictTypesPass.php
strictTypes = $strictTypes; } /** * If this is a standalone strict types declaration, remember it for later. * * Otherwise, apply remembered strict types declaration to to the code until * a new declaration is encountered. * * @throws FatalErrorException if an invalid `strict_types` declaration is found * * @param array $nodes * * @return Node[]|null Array of nodes */ public function beforeTraverse(array $nodes) { $prependStrictTypes = $this->strictTypes; foreach ($nodes as $node) { if ($node instanceof Declare_) { foreach ($node->declares as $declare) { if ($declare->key->toString() === 'strict_types') { $value = $declare->value; // @todo Rename LNumber to Int_ once we drop support for PHP-Parser 4.x if (!$value instanceof LNumber || ($value->value !== 0 && $value->value !== 1)) { throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getStartLine()); } $this->strictTypes = $value->value === 1; } } } } if ($prependStrictTypes) { $first = \reset($nodes); if (!$first instanceof Declare_) { // @todo Switch to PhpParser\Node\DeclareItem once we drop support for PHP-Parser 4.x // @todo Rename LNumber to Int_ once we drop support for PHP-Parser 4.x $declareItem = \class_exists('PhpParser\Node\DeclareItem') ? new DeclareItem('strict_types', new LNumber(1)) : new DeclareDeclare('strict_types', new LNumber(1)); $declare = new Declare_([$declareItem]); \array_unshift($nodes, $declare); } } return $nodes; } }