Creates the new return type for fixing or returns a null if not possible.

@return string
979772
private function createReturnType(): string
    {
        $returnTypeHint = '';
        $typeCount = count($this->typesForFix);

        foreach ($this->typesForFix as $type) {
            // We add the default value if only null is used (which has no real native return type).
            if ($type === 'null' && ($typeCount === 1)) {
                $returnTypeHint = $this->defaultNullReturn;
                break; // We still need this break to prevent further execution of the default value.
            }

            // We add the question mark if there is a nullable type.
            if (in_array($type, self::NULL_TYPES, true) && ($typeCount > 1)) {
                $returnTypeHint = '?' . $returnTypeHint;
                continue; // We still need this continue to prevent further execution of the questionmark.
            }

            // We add a fixable "native" type. We do not fix custom classes (because it would have side effects to the
            // imported usage of classes.
            $returnTypeHint .= (TypeHintHelper::isSimpleTypeHint($type))
                ? TypeHintHelper::convertLongSimpleTypeHintToShort($type)
                : $type;
        }

        return $returnTypeHint;
    }
127630
static function registeredDataTypes()
    {
        $types = isset( $GLOBALS["eZDataTypes"] ) ? $GLOBALS["eZDataTypes"] : null;
        if ( isset( $types ) )
        {
            foreach ( $types as $dataTypeString => $className )
            {
                if ( !isset( $GLOBALS["eZDataTypeObjects"][$dataTypeString] ) )
                {
                    $GLOBALS["eZDataTypeObjects"][$dataTypeString] = new $className();
                }
            }
            uasort( $GLOBALS["eZDataTypeObjects"], function ( $a, $b ) { return strcmp( $a->Name, $b->Name); } );
        return $GLOBALS["eZDataTypeObjects"];
        }
        return null;
    }
587110
public static function create()
    {
        return new ResolverStack([
            new OffsetResolver(false),
            new HeadResolver(false),
            new FirstLastResolver(false),
            new FilenameResolver(false),
            new LazyIdResolver(false),
        ]);
    }
992045
public function getResult()
	{
		$result = $this->error ?? $this->result ?? null;
		if ($result === null) {
			return null;
		}

		return Dumper::toHtml($result, [
			Dumper::COLLAPSE => true
		]);
	}
1126959
public static function getCaller()
    {
        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
        if (isset($backtrace[2])) {
            $caller = '';
            if (isset($backtrace[2]['class'])) {
                $caller = $backtrace[2]['class'] . $backtrace[2]['type'];
            }
            $caller .= $backtrace[2]['function'];
            return $caller;
        }
        return '{null}';
    }
809659
function serialize_return() {
		$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
		// if fault
		if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
			$this->debug('got a fault object from method');
			$this->fault = $this->methodreturn;
			return;
		} elseif ($this->methodreturnisliteralxml) {
			$return_val = $this->methodreturn;
		// returned value(s)
		} else {
			$this->debug('got a(n) '.gettype($this->methodreturn).' from method');
			$this->debug('serializing return value');
			if($this->wsdl){
				if (sizeof($this->opData['output']['parts']) > 1) {
					$this->debug('more than one output part, so use the method return unchanged');
			    	$opParams = $this->methodreturn;
			    } elseif (sizeof($this->opData['output']['parts']) == 1) {
					$this->debug('exactly one output part, so wrap the method return in a simple array');
					// TODO: verify that it is not already wrapped!
			    	//foreach ($this->opData['output']['parts'] as $name => $type) {
					//	$this->debug('wrap in element named ' . $name);
			    	//}
			    	$opParams = array($this->methodreturn);
			    }
			    $return_val = $this->wsdl->serializeRPCParameters($this->methodname,'output',$opParams);
			    $this->appendDebug($this->wsdl->getDebug());
			    $this->wsdl->clearDebug();
				if($errstr = $this->wsdl->getError()){
					$this->debug('got wsdl error: '.$errstr);
					$this->fault('SOAP-ENV:Server', 'unable to serialize result');
					return;
				}
			} else {
				if (isset($this->methodreturn)) {
					$return_val = $this->serialize_val($this->methodreturn, 'return');
				} else {
					$return_val = '';
					$this->debug('in absence of WSDL, assume void return for backward compatibility');
				}
			}
		}
		$this->debug('return value:');
		$this->appendDebug($this->varDump($return_val));

		$this->debug('serializing response');
		if ($this->wsdl) {
			$this->debug('have WSDL for serialization: style is ' . $this->opData['style']);
			if ($this->opData['style'] == 'rpc') {
				$this->debug('style is rpc for serialization: use is ' . $this->opData['output']['use']);
				if ($this->opData['output']['use'] == 'literal') {
					// http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace
					if ($this->methodURI) {
						$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
					} else {
						$payload = '<'.$this->methodname.'Response>'.$return_val.'</'.$this->methodname.'Response>';
					}
				} else {
					if ($this->methodURI) {
						$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
					} else {
						$payload = '<'.$this->methodname.'Response>'.$return_val.'</'.$this->methodname.'Response>';
					}
				}
			} else {
				$this->debug('style is not rpc for serialization: assume document');
				$payload = $return_val;
			}
		} else {
			$this->debug('do not have WSDL for serialization: assume rpc/encoded');
			$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
		}
		$this->result = 'successful';
		if($this->wsdl){
			//if($this->debug_flag){
            	$this->appendDebug($this->wsdl->getDebug());
            //	}
			if (isset($this->opData['output']['encodingStyle'])) {
				$encodingStyle = $this->opData['output']['encodingStyle'];
			} else {
				$encodingStyle = '';
			}
			// Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces.
			$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders,$this->wsdl->usedNamespaces,$this->opData['style'],$this->opData['output']['use'],$encodingStyle);
		} else {
			$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders);
		}
		$this->debug("Leaving serialize_return");
	}
413714
public static function create()
    {
        $ob = new stdClass;
        $ob->value = self::DEFAULT_CONTENT_TYPE;

        return new self(null, $ob);
    }
910529
public function getType(): string
    {
        if (null === $this->type) {
            $success = true;

            $type = $this->getItem('browscap.type', false, $success);

            if (null !== $type && $success) {
                $this->type = $type;
            }
        }

        return $this->type;
    }
771089
protected function createBeforeFilter() {
    $before = $this->before;

    // closure that iterates over all before filters
    return function ($request) use ($before) {
      foreach ($before as $filter) {
        $response = $filter->onBefore($request);
        if (!is_null($response)) {
          return $response;
        }
      }

      return null;
    };
  }
1109954
public function createObjectType() : ObjectConstructorCallbackDefiner
    {
        return new ObjectConstructorCallbackDefiner($this->class, function (callable $typeCallback) {
            $this->createObjectCallback = function (array $input) use ($typeCallback) {
                $className = $this->class->getClassName();

                /** @var ValueObject $valueObject */
                $valueObject = $typeCallback($input);

                if (!($valueObject instanceof $className)) {
                    throw InvalidReturnValueException::format(
                        'Invalid create object callback return value: expecting class compatible with %s, %s given',
                        $className, is_string($valueObject) ? $valueObject : Debug::getType($valueObject)
                    );
                }

                return $valueObject;
            };
        });
    }
724736
public function getResultType()
    {
        return is_object($this->result) ? sprintf('object[%s]', get_class($this->result)) : gettype($this->result);
    }
529381
public function asNull(): Primitive\NullType
    {
        if (!$this->_element instanceof Primitive\NullType) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_NULL));
        }
        return $this->_element;
    }
51986
private function writePhpFunction(): string
    {
        $phpFunction = $this->method->getPhpDoc();
        if ($this->method->getReturnType() !== 'mixed' && $this->method->getReturnType() !== 'resource') {
            $returnType = ': ' . $this->method->getReturnType();
        } else {
            $returnType = '';
        }
        $returnStatement = '';
        if ($this->method->getReturnType() !== 'void') {
            $returnStatement = "    return \$result;\n";
        }
        $moduleName = $this->method->getModuleName();

        $phpFunction .= "function {$this->method->getFunctionName()}({$this->displayParamsWithType($this->method->getParams())}){$returnType}
{
    error_clear_last();
";

        if (!$this->method->isOverloaded()) {
            $phpFunction .= '    $result = '.$this->printFunctionCall($this->method);
        } else {
            $method = $this->method;
            $inElse = false;
            do {
                $lastParameter = $method->getParams()[count($method->getParams())-1];
                if ($inElse) {
                    $phpFunction .= ' else';
                } else {
                    $phpFunction .= '    ';
                }
                if ($lastParameter->isVariadic()) {
                    $defaultValueToString = '[]';
                } else {
                    $defaultValue = $lastParameter->getDefaultValue();
                    $defaultValueToString = $this->defaultValueToString($defaultValue);
                }
                $phpFunction .= 'if ($'.$lastParameter->getParameter().' !== '.$defaultValueToString.') {'."\n";
                $phpFunction .= '        $result = '.$this->printFunctionCall($method)."\n";
                $phpFunction .= '    }';
                $inElse = true;
                $method = $method->cloneAndRemoveAParameter();
                if (!$method->isOverloaded()) {
                    break;
                }
            } while (true);
            $phpFunction .= 'else {'."\n";
            $phpFunction .= '        $result = '.$this->printFunctionCall($method)."\n";
            $phpFunction .= '    }';
        }

        $phpFunction .= $this->generateExceptionCode($moduleName, $this->method).$returnStatement. '}

';

        return $phpFunction;
    }
1305659
public function getNewType($type = null)
    {
        $className = $this->getTypeClass($type);
        /** @var GenericType $object */
        $object = new $className();
        $object->setManager($this);

        return $object;
    }
461613
public static function i()
    {
        $class = get_called_class();
        $initArgs = func_get_args();
        if (count($initArgs) === 1) {
            $initArgs = $initArgs[0];
        }

        if (!empty(self::$_baseInstances[$class])) {
            $inst = self::$_baseInstances[$class];
            if (!empty($initArgs)) {
                $inst->initConfig($initArgs);
            }

            return $inst;
        }

        return new $class($initArgs);
    }
116546
public static function singleton()
    {
        $returnValue = null;

        
        $cacheName = get_called_class();
        if (!isset(self::$instances[$cacheName])) {
        	self::$instances[$cacheName] = new $cacheName();
        }
        
        $returnValue = self::$instances[$cacheName];
        

        return $returnValue;
    }
384973
private function newExpr() {
    $node = new NewNode();
    $this->mustMatch(T_NEW, $node);
    $node->addChild($this->classNameReference(), 'className');
    if ($this->currentType === '(') {
      $this->functionCallParameterList($node);
    }
    return $node;
  }