public function output() { if ($this->manualCastTo !== null) { return [$this->referencesTo->getPropertyName() . ' as ' . $this->manualCastTo->value()]; } return [$this->referencesTo->getPropertyName()]; }
public function output() { $codeLines = []; $localScope = []; foreach ($this->localScope->getLocalVariables() as $localVariable) { $localScope[] = $localVariable->getPropertyType()->output() . ' ' . $localVariable->getPropertyName(); } $localScope = '(' . implode(', ', $localScope) . ')'; $functionReturnType = $this->returnType !== null ? $this->returnType->value() . ' ' : ""; $codeLines[] = $functionReturnType . "Function " . $this->functionName . $localScope; $codeLines = array_merge($codeLines, $this->codeScope->output()); $codeLines[] = "EndFunction"; return $codeLines; }
public function output() { return [$this->type->value() . ' ' . $this->variableName]; }
public static function findReturnTypeForObjectCall(TES5Type $calledOnType, $methodName) { if (!isset(self::$callReturns[$calledOnType->value()])) { //Type not present in inheritance graph, check if its a basic type ( which means its basically an exception ) if ($calledOnType->isNativePapyrusType()) { throw new ConversionException("Inference type exception - no call returns for " . $calledOnType->value() . "!"); } else { //Otherwise, treat it like a base script $calledOnType = $calledOnType->getNativeType(); } } foreach (self::$callReturns[$calledOnType->value()] as $method => $functionData) { if (strtolower($method) == strtolower($methodName)) { return TES5TypeFactory::memberByValue($functionData['returnType']); } } return self::findReturnTypeForObjectCall(self::findBaseClassFor($calledOnType), $methodName); }