@inheritDoc

@psalm-suppress InvalidReturnType Returning an object here is required
for creating a valid Apigee Edge request.
429683
public function normalize($object, $format = null, array $context = [])
    {
        /** @var object $normalized */
        $normalized = parent::normalize($object, $format, $context);
        if ($object instanceof RatePlanRateRevShare) {
            $normalized->type = RatePlanRate::TYPE_REVSHARE;
        } else {
            $normalized->type = RatePlanRate::TYPE_RATECARD;
        }

        return $normalized;
    }
927789
public function getValue($returnObject = false){

        $returnValue = null;

        if(!is_null($this->value)){
            $returnValue = ($returnObject) ? $this->value : $this->value->getValue(); //return mixed
        }

        return $returnValue;
    }
274729
public function verifyReturnType(
        StatementsAnalyzer $statements_analyzer,
        Type\Union $return_type = null,
        $fq_class_name = null,
        CodeLocation $return_type_location = null
    ) {
        ReturnTypeAnalyzer::verifyReturnType(
            $this->function,
            $statements_analyzer,
            $this,
            $return_type,
            $fq_class_name,
            $return_type_location
        );
    }
923457
public static Class<?> getReturnType(final Object bean,
			final String methodName) {
		Validate.notNull(bean, "Bean required");
		Validate.notEmpty(methodName, "Not empty method name required");

		for (Method method : bean.getClass().getMethods()) {
			if (method.getName().equals(methodName) && !method.isBridge()) {
				return method.getReturnType();
			}
		}
		throw new IllegalArgumentException("Method " + methodName
				+ " not found in class " + bean.getClass().getName());
	}
584631
public function GetReturnType( $dataPool )
	{
		if ( ! is_null( $this->_returnTypeDelegate ) )
		{
			/**
			 * @var XPath2ResultType $resType1
			 */
			$resType1 = $this->getAbstractNode(0)->GetReturnType( $dataPool );
			/**
			 * @var XPath2ResultType $resType2
			 */
			$resType2 = $this->getAbstractNode(1)->GetReturnType( $dataPool );
			return call_user_func( $this->_returnTypeDelegate, $resType1, $resType2 );
			// return $this->_returnTypeDelegate( $resType1, $resType2 );
		}
		return parent::GetReturnType( $dataPool );
	}
421601
protected function getInvalidReturnType($comment)
    {
        if (preg_match(self::ALLOWED_RETURN_TYPES_PATTERN, $comment, $returnType)) {
            return $returnType[self::INVALID_RETURN_TYPE_MATCH];
        }

        return false;
    }
318484
private void processIntegerReturn() {
        if ((sawConstant == null) && (stack.getStackDepth() == 0)) {
            throw new StopOpcodeParsingException();
        }

        Integer returnValue = null;
        if (sawConstant == null) {
            OpcodeStack.Item item = stack.getStackItem(0);
            returnValue = (Integer) item.getConstant();
        } else {
            returnValue = sawConstant;
        }

        if (returnValue == null) {
            throw new StopOpcodeParsingException();
        }
        int v = returnValue.intValue();
        if (v < 0) {
            seenNegative = true;
            if (getPC() > furthestBranchTarget) {
                seenUnconditionalNonZero = true;
            }
        } else if (v > 0) {
            seenPositive = true;
            if (getPC() > furthestBranchTarget) {
                seenUnconditionalNonZero = true;
            }
        } else {
            seenZero = true;
        }

        sawConstant = null;
    }
724467
public static function getReturnTypeFromCallMap($function_id)
    {
        $call_map_key = strtolower($function_id);

        $call_map = self::getCallMap();

        if (!isset($call_map[$call_map_key])) {
            throw new \InvalidArgumentException('Function ' . $function_id . ' was not found in callmap');
        }

        if (!$call_map[$call_map_key][0]) {
            return Type::getMixed();
        }

        $call_map_type = Type::parseString($call_map[$call_map_key][0]);

        if ($call_map_type->isNullable()) {
            $call_map_type->from_docblock = true;
        }

        return $call_map_type;
    }
677269
public Object get(ULocale locale, ULocale[] actualReturn) {
        return get(locale, LocaleKey.KIND_ANY, actualReturn);
    }
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;
            };
        });
    }
318059
public function normalize($object, $format = null, array $context = [])
    {
        if (isset($context['api_sub_level'])) {
            return $this->normalizeRawCollection($object, $format, $context);
        }

        try {
            $resourceClass = $this->resourceClassResolver->getResourceClass($object, $context['resource_class'] ?? null, true);
        } catch (InvalidArgumentException $e) {
            if (!isset($context['resource_class'])) {
                return $this->normalizeRawCollection($object, $format, $context);
            }

            throw $e;
        }
        $data = [];
        $context = $this->initContext($resourceClass, $context);

        return array_merge_recursive(
            $data,
            $this->getPaginationData($object, $context),
            $this->getItemsData($object, $format, $context)
        );
    }
32278
private function checkAndReturnAnswer(WritableContentInterface $object): string
    {
        $returnValue = '';
        if ($object->shouldExpectAnswer() === true) {
            $this->enableSynchronousTransfer(true);
            $returnValue = $this->readBrokerHeader();
            $this->enableSynchronousTransfer(false);
        }

        return $returnValue;
    }
278350
private Status executeReturn(Stmt.Return stmt, CallStack frame, EnclosingScope scope) {
		// We know that a return statement can only appear in either a function
		// or method declaration. It cannot appear, for example, in a type
		// declaration. Therefore, the enclosing declaration is a function or
		// method.
		Decl.Callable context = scope.getEnclosingScope(FunctionOrMethodScope.class).getContext();
		Tuple<Decl.Variable> returns = context.getReturns();
		RValue[] values = executeExpressions(stmt.getReturns(), frame);
		for (int i = 0; i != returns.size(); ++i) {
			frame.putLocal(returns.get(i).getName(), values[i]);
		}
		return Status.RETURN;
	}
182931
protected static function apiCall($provider, $method, $uri, $params = [])
    {
        $methodName = $method . 'ApiCall';
        if (method_exists($provider, $methodName)) {
            return $provider->{$methodName}($uri, $params);
        }
        throw new InvalidRequestException();
    }
925090
protected function completeLeafValue($returnType, &$result)
    {
        $result = $returnType->serialize($result);

        if (null === $result) {
            throw new InvalidReturnTypeException($returnType, $result);
        }

        return $result;
    }
630221
private function box($method, $returnValue)
    {
        set_error_handler(__CLASS__.'::onInternalError');

        try {
            $args = func_get_args();
            unset($args[0], $args[1]);
            $this->debug('Boxing '.$method);
            $returnValue = call_user_func_array(array($this, $method), $args);
        } catch (Exception $e) {
            $this->warn(get_class($e).': '.$e->getMessage().' in '.$e->getFile().':'.$e->getLine());
            restore_error_handler();
            $this->profilerDisable();
            $this->responseLine = 'Blackfire-Error: 101 '.rawurlencode($e->getMessage().' in '.$e->getFile().':'.$e->getLine());
        }

        self::restoreErrorHandler();

        return $returnValue;
    }
1135009
public function extract($object)
    {
        if (!$object instanceof Entity) {
            throw new \InvalidArgumentException('$object must be an instance of EmailVerification entity');
        }
        /* @var $object Entity*/
        $data = parent::extract($object);
        if ($data['request_time'] instanceof \DateTime) {
            $data['request_time'] = $data['request_time']->format('Y-m-d H:i:s');
        }

        return $data;
    }