Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
InterceptedMethod.php
01 <?php
02
03 declare(strict_types=1);
04
05 namespace ProxyManager\ProxyGenerator\AccessInterceptorScopeLocalizer\MethodGenerator;
06
07 use ProxyManager\Generator\MethodGenerator;
08 use ProxyManager\ProxyGenerator\AccessInterceptorScopeLocalizer\MethodGenerator\Util\InterceptorGenerator;
09 use Zend\Code\Generator\PropertyGenerator;
10 use Zend\Code\Reflection\MethodReflection;
11
12 /**
13 * Method with additional pre- and post- interceptor logic in the body
14 *
15 * @author Marco Pivetta <ocramius@gmail.com>
16 * @license MIT
17 */
18 class InterceptedMethod extends MethodGenerator
19 {
20 /**
21 * @throws \Zend\Code\Generator\Exception\InvalidArgumentException
22 */
23 public static function generateMethod(
24 MethodReflection $originalMethod,
25 PropertyGenerator $prefixInterceptors,
26 PropertyGenerator $suffixInterceptors
27 ) : self {
28 /* @var $method self */
29 $method = static::fromReflectionWithoutBodyAndDocBlock($originalMethod);
30 $forwardedParams = [];
31
32 foreach ($originalMethod->getParameters() as $parameter) {
33 $forwardedParams[] = ($parameter->isVariadic() ? '...' : '') . '$' . $parameter->getName();
34 }
35
36 $method->setBody(InterceptorGenerator::createInterceptedMethodBody(
37 '$returnValue = parent::'
38 . $originalMethod->getName() . '(' . implode(', ', $forwardedParams) . ');',
39 $method,
40 $prefixInterceptors,
41 $suffixInterceptors,
42 $originalMethod
43 ));
44
45 return $method;
46 }
47 }
48