getNumberOfParameters() > 0 || $methodReflection->hasReturnType() ? "\n\n - Parameters [%d] {%s\n }" : ''; $returnTypeFormat = $methodReflection->hasReturnType() ? "\n - Return [ %s ]" : ''; $string = sprintf( 'Method [ <%s%s%s%s%s%s>%s%s%s %s method %s ] {%s' . $parametersFormat . $returnTypeFormat . "\n}", self::sourceToString($methodReflection), $methodReflection->isConstructor() ? ', ctor' : '', $methodReflection->isDestructor() ? ', dtor' : '', self::overwritesToString($methodReflection), self::inheritsToString($methodReflection), self::prototypeToString($methodReflection), $methodReflection->isFinal() ? ' final' : '', $methodReflection->isStatic() ? ' static' : '', $methodReflection->isAbstract() ? ' abstract' : '', self::visibilityToString($methodReflection), $methodReflection->getName(), self::fileAndLinesToString($methodReflection), count($methodReflection->getParameters()), self::parametersToString($methodReflection), self::returnTypeToString($methodReflection), ); assert($string !== ''); return $string; } /** * @psalm-pure */ private static function sourceToString(ReflectionMethod $methodReflection): string { if ($methodReflection->isUserDefined()) { return 'user'; } $extensionName = $methodReflection->getExtensionName(); assert(is_string($extensionName)); return sprintf('internal:%s', $extensionName); } /** * @psalm-pure */ private static function overwritesToString(ReflectionMethod $methodReflection): string { $parentClass = $methodReflection->getDeclaringClass()->getParentClass(); if ($parentClass === null) { return ''; } if (! $parentClass->hasMethod($methodReflection->getName())) { return ''; } return sprintf(', overwrites %s', $parentClass->getName()); } /** * @psalm-pure */ private static function inheritsToString(ReflectionMethod $methodReflection): string { if ($methodReflection->getDeclaringClass() === $methodReflection->getCurrentClass()) { return ''; } return sprintf(', inherits %s', $methodReflection->getDeclaringClass()->getName()); } /** * @psalm-pure */ private static function prototypeToString(ReflectionMethod $methodReflection): string { try { return sprintf(', prototype %s', $methodReflection->getPrototype()->getDeclaringClass()->getName()); } catch (MethodPrototypeNotFound) { return ''; } } /** * @psalm-pure */ private static function visibilityToString(ReflectionMethod $methodReflection): string { if ($methodReflection->isProtected()) { return 'protected'; } if ($methodReflection->isPrivate()) { return 'private'; } return 'public'; } /** * @psalm-pure */ private static function fileAndLinesToString(ReflectionMethod $methodReflection): string { if ($methodReflection->isInternal()) { return ''; } $fileName = $methodReflection->getFileName(); assert(is_string($fileName)); return sprintf("\n @@ %s %d - %d", $fileName, $methodReflection->getStartLine(), $methodReflection->getEndLine()); } /** * @psalm-pure */ private static function parametersToString(ReflectionMethod $methodReflection): string { return array_reduce($methodReflection->getParameters(), static fn (string $string, ReflectionParameter $parameterReflection): string => $string . "\n " . ReflectionParameterStringCast::toString($parameterReflection), ''); } /** * @psalm-pure */ private static function returnTypeToString(ReflectionMethod $methodReflection): string { $type = $methodReflection->getReturnType(); if ($type === null) { return ''; } return ReflectionTypeStringCast::toString($type); } } __halt_compiler();----SIGNATURE:----MEs1bKahj6dH6ZoAu68RA4TEyrY5QRRV+NtTPRYTvwihMyYscuGmLG2DPCuWdoxgZqngNNOWx4El9nFC6Ts3k3Vm4nlRuckhl5zs2QR5Oh9iDxwYti5FlUlVA9QxNOHgzslvE7EYvVpKMxy1WBtpLeFv+tL/FC4tPhXZViBNjisEma4Q9aNuWyCYP0tuefgEMRAPwC5oX9xXVTdHdjbDsJI0hbUBEde3sPPUnDGlMhqcRf2XkPFy6db+88qu69MricwktkugptB4JvaA5HxJHE1HS6RiKT8Q7K7loQ+YfM09V/QRQM6X+bM+lLzcFiDMf3RivH0DJbilrknfWJv+fCpmrGeZxwxupReLgMpBbw0q4JLzB5hem0s9z3cuERwfNzR3SH8skT4W7E4fa4nxq4Kidmqrem9pFSXuniECzIbYiARTeNi3hQzv1td99ibWW1vg/2U0vP7ALyqxHVQEgupHn/sazLHfVBDSgMZKs9DvbHXMaDuNIO9EZJzp4gF6gX5rW/BQXOd/GDu8lqQbmyJP/0XJ/dfvon0BR15cp15p2Gy4fmS0KzgtEz7zjdmHO8RTcIoAF3zzKayL7oJuWHFtrZz2BQPYBEqLwEWOIpaxBaxCh3lf9z9gwFYNuuTnLwc945cCKwzNdnJj/c9IWL6HZ+ehbBgdSHkGACwxsCE=----ATTACHMENT:----NDIwMTI4NDc4NDMwODI2OCAyMjgwMTcyMjg0ODA3MjgxIDk1OTY3MjI3ODgzNjcwNjA=