readObjectFromStubNode($node); $function->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $function->stubBelongsToCore = true; } $this->stubs->addFunction($function); } elseif ($node instanceof Const_) { $constant = (new PHPConst())->readObjectFromStubNode($node); $constant->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $constant->stubBelongsToCore = true; } if ($constant->parentName === null) { $this->stubs->addConstant($constant); } elseif ($this->stubs->getClass($constant->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getClass($constant->parentName, $this->sourceFilePath, false)->addConstant($constant); } elseif ($this->stubs->getInterface($constant->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getInterface($constant->parentName, $this->sourceFilePath, false)->addConstant($constant); } } elseif ($node instanceof FuncCall) { if ($node->name->parts[0] === 'define') { $constant = (new PHPDefineConstant())->readObjectFromStubNode($node); $constant->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $constant->stubBelongsToCore = true; } $this->stubs->addConstant($constant); } } elseif ($node instanceof ClassMethod) { $method = (new PHPMethod())->readObjectFromStubNode($node); $method->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $method->stubBelongsToCore = true; } if ($this->stubs->getClass($method->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getClass($method->parentName, $this->sourceFilePath, false)->addMethod($method); } elseif ($this->stubs->getInterface($method->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getInterface($method->parentName, $this->sourceFilePath, false)->addMethod($method); } } elseif ($node instanceof Interface_) { $interface = (new PHPInterface())->readObjectFromStubNode($node); $interface->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $interface->stubBelongsToCore = true; } $this->stubs->addInterface($interface); } elseif ($node instanceof Class_) { $class = (new PHPClass())->readObjectFromStubNode($node); $class->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $class->stubBelongsToCore = true; } $this->stubs->addClass($class); } elseif ($node instanceof Node\Stmt\Property) { $property = (new PHPProperty())->readObjectFromStubNode($node); $property->sourceFilePath = $this->sourceFilePath; if ($this->isStubCore) { $property->stubBelongsToCore = true; } if ($this->stubs->getClass($property->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getClass($property->parentName, $this->sourceFilePath, false)->addProperty($property); } } } /** * @throws RuntimeException */ public function combineParentInterfaces(PHPInterface $interface): array { $parents = []; if (empty($interface->parentInterfaces)) { return $parents; } /** @var string $parentInterface */ foreach ($interface->parentInterfaces as $parentInterface) { $parents[] = $parentInterface; if ($this->stubs->getInterface( $parentInterface, $interface->stubBelongsToCore ? null : $interface->sourceFilePath, false ) !== null) { foreach ($this->combineParentInterfaces( $this->stubs->getInterface( $parentInterface, $interface->stubBelongsToCore ? null : $interface->sourceFilePath, false ) ) as $value) { $parents[] = $value; } } } return $parents; } /** * @throws RuntimeException */ public function combineImplementedInterfaces(PHPClass $class): array { $interfaces = []; /** @var string $interface */ foreach ($class->interfaces as $interface) { $interfaces[] = $interface; if ($this->stubs->getInterface( $interface, $class->stubBelongsToCore ? null : $class->sourceFilePath, false ) !== null) { $interfaces[] = $this->stubs->getInterface( $interface, $class->stubBelongsToCore ? null : $class->sourceFilePath, false )->parentInterfaces; } } if ($class->parentClass === null) { return $interfaces; } if ($this->stubs->getClass( $class->parentClass, $class->stubBelongsToCore ? null : $class->sourceFilePath, false ) !== null) { $inherited = $this->combineImplementedInterfaces($this->stubs->getClass( $class->parentClass, $class->stubBelongsToCore ? null : $class->sourceFilePath, false )); $interfaces[] = CommonUtils::flattenArray($inherited, false); } return $interfaces; } } __halt_compiler();----SIGNATURE:----PBRFey1ARrreYqKeNI5KWOy8VYbDhFYh6EpNaxCwGre9qIUZ68apL2T8vbU+5RWd2z3vgV7DLa3Vlbmes0scJsCYUFEm+z/THa241Qw0kiJa+GD/AAc4g4Z8gy/a/txuJs4msKI5RDtu9ZKz6QoxJ9yhtud+QYlOzK4+3kR+d4IkSyYLkSV/b4WhT8dBJX9i/ZqMBg3yBmgyCaPAcjVWzDOOCingOzugJBmtWIPFQWFSG4ckg9W2WvfjXIwW96X2pMBbS1ja4XX85hq9l81+iOeRYfeCZsI/9FyOHTafv/19IvdiX8cUxJGpopY3uYwI+VfX8FfXt1PEXvotfWtbTX7DnFrqTw9v4Ga6fsP4l0AQKgm/aeSlOt+X4AJqZaYwqQbjTwvNbUX+WfWpO7fqAUX+xTuyA4ZDozCUaEJu4rLAuwPtbOCYLFQjx434MeTvRteEd62ZGDR6o3ObgvQDlydRgCCnGFz/EB4tB6CmtzDbMCXCTObZF7VL9GHD8PDl+yaOKTMJijzed65f/JaxBdAKx6dZaKJfDAL6bbAvHPqh/R4+bNcjwFuHwIpDC3lJ8D4lEVqMm9i7DrggkygVqp2nBp5bzUpMZxJ3YUVoU82ryXVNr7JkFn0bSUWJ5JB8l2kXdnjFqggols1F1QMjWe6nzDzNgaMsFGXb25TO7bw=----ATTACHMENT:----NTAyMDA4MzE1MDc4Njc2MyAzMzI4NzE2OTk4NDE1NTM0IDk0ODcxNDc4MjcxMDUwNzE=