PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` atLeastPhp71 = \version_compare(\PHP_VERSION, '7.1', '>='); } /** * {@inheritdoc} */ public function enterNode(Node $node) { if (!$this->atLeastPhp71) { return; // @codeCoverageIgnore } if ($this->isFunctionNode($node)) { $this->returnTypeStack[] = $node->returnType; return; } if (!empty($this->returnTypeStack) && $node instanceof Return_) { $expectedType = \end($this->returnTypeStack); if ($expectedType === null) { return; } $msg = null; if ($this->typeName($expectedType) === 'void') { // Void functions if ($expectedType instanceof NullableType) { $msg = self::NULLABLE_VOID_MESSAGE; } elseif ($node->expr instanceof ConstFetch && \strtolower($node->expr->name) === 'null') { $msg = self::VOID_NULL_MESSAGE; } elseif ($node->expr !== null) { $msg = self::VOID_MESSAGE; } } else { // Everything else if ($node->expr === null) { $msg = $expectedType instanceof NullableType ? self::NULLABLE_MESSAGE : self::MESSAGE; } } if ($msg !== null) { throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine()); } } } /** * {@inheritdoc} */ public function leaveNode(Node $node) { if (!$this->atLeastPhp71) { return; // @codeCoverageIgnore } if (!empty($this->returnTypeStack) && $this->isFunctionNode($node)) { \array_pop($this->returnTypeStack); } } private function isFunctionNode(Node $node): bool { return $node instanceof Function_ || $node instanceof Closure; } private function typeName(Node $node): string { if ($node instanceof UnionType) { return \implode('|', \array_map([$this, 'typeName'], $node->types)); } if ($node instanceof NullableType) { return \strtolower($node->type->name); } if ($node instanceof Identifier) { return \strtolower($node->name); } throw new \InvalidArgumentException('Unable to find type name'); } }