protected function buildMethodsAndAdvicesArrayCode(array $methodsAndGroupedAdvices): string
    {
        if (count($methodsAndGroupedAdvices) < 1) {
            return '';
        }

        $methodsAndAdvicesArrayCode = "\n        \$objectManager = \\Neos\\Flow\\Core\\Bootstrap::\$staticObjectManager;\n";
        $methodsAndAdvicesArrayCode .= "        \$this->Flow_Aop_Proxy_targetMethodsAndGroupedAdvices = array(\n";
        foreach ($methodsAndGroupedAdvices as $methodName => $advicesAndDeclaringClass) {
            $methodsAndAdvicesArrayCode .= "            '" . $methodName . "' => array(\n";
            foreach ($advicesAndDeclaringClass['groupedAdvices'] as $adviceType => $adviceConfigurations) {
                $methodsAndAdvicesArrayCode .= "                '" . $adviceType . "' => array(\n";
                foreach ($adviceConfigurations as $adviceConfiguration) {
                    $advice = $adviceConfiguration['advice'];
                    $methodsAndAdvicesArrayCode .= "                    new \\" . get_class($advice) . "('" . $advice->getAspectObjectName() . "', '" . $advice->getAdviceMethodName() . "', \$objectManager, " . $adviceConfiguration['runtimeEvaluationsClosureCode'] . "),\n";
                }
                $methodsAndAdvicesArrayCode .= "                ),\n";
            }
            $methodsAndAdvicesArrayCode .= "            ),\n";
        }
        $methodsAndAdvicesArrayCode .= "        );\n";
        return $methodsAndAdvicesArrayCode;
    }
protected function buildMethodsAndAdvicesArrayCode(array $methodsAndGroupedAdvices): string
    {
        if (count($methodsAndGroupedAdvices) < 1) {
            return '';
        }

        $methodsAndAdvicesArrayCode = "\n        \$objectManager = \\Neos\\Flow\\Core\\Bootstrap::\$staticObjectManager;\n";
        $methodsAndAdvicesArrayCode .= "        \$this->Flow_Aop_Proxy_targetMethodsAndGroupedAdvices = array(\n";
        foreach ($methodsAndGroupedAdvices as $methodName => $advicesAndDeclaringClass) {
            $methodsAndAdvicesArrayCode .= "            '" . $methodName . "' => array(\n";
            foreach ($advicesAndDeclaringClass['groupedAdvices'] as $adviceType => $adviceConfigurations) {
                $methodsAndAdvicesArrayCode .= "                '" . $adviceType . "' => array(\n";
                foreach ($adviceConfigurations as $adviceConfiguration) {
                    $advice = $adviceConfiguration['advice'];
                    $methodsAndAdvicesArrayCode .= "                    new \\" . get_class($advice) . "('" . $advice->getAspectObjectName() . "', '" . $advice->getAdviceMethodName() . "', \$objectManager, " . $adviceConfiguration['runtimeEvaluationsClosureCode'] . "),\n";
                }
                $methodsAndAdvicesArrayCode .= "                ),\n";
            }
            $methodsAndAdvicesArrayCode .= "            ),\n";
        }
        $methodsAndAdvicesArrayCode .= "        );\n";
        return $methodsAndAdvicesArrayCode;
    }
protected function buildMethodsAndAdvicesArrayCode ( array $ methodsAndGroupedAdvices ) : string { if ( count ( $ methodsAndGroupedAdvices ) < 1 ) { return '' ; } $ methodsAndAdvicesArrayCode = "\n        \$objectManager = \\Neos\\Flow\\Core\\Bootstrap::\$staticObjectManager;\n" ; $ methodsAndAdvicesArrayCode .= "        \$this->Flow_Aop_Proxy_targetMethodsAndGroupedAdvices = array(\n" ; foreach ( $ methodsAndGroupedAdvices as $ methodName => $ advicesAndDeclaringClass ) { $ methodsAndAdvicesArrayCode .= "            '" . $ methodName . "' => array(\n" ; foreach ( $ advicesAndDeclaringClass [ 'groupedAdvices' ] as $ adviceType => $ adviceConfigurations ) { $ methodsAndAdvicesArrayCode .= "                '" . $ adviceType . "' => array(\n" ; foreach ( $ adviceConfigurations as $ adviceConfiguration ) { $ advice = $ adviceConfiguration [ 'advice' ] ; $ methodsAndAdvicesArrayCode .= "                    new \\" . get_class ( $ advice ) . "('" . $ advice -> getAspectObjectName ( ) . "', '" . $ advice -> getAdviceMethodName ( ) . "', \$objectManager, " . $ adviceConfiguration [ 'runtimeEvaluationsClosureCode' ] . "),\n" ; } $ methodsAndAdvicesArrayCode .= "                ),\n" ; } $ methodsAndAdvicesArrayCode .= "            ),\n" ; } $ methodsAndAdvicesArrayCode .= "        );\n" ; return $ methodsAndAdvicesArrayCode ; }
Creates code for an array of target methods and their advices.

Example:

$this->Flow_Aop_Proxy_targetMethodsAndGroupedAdvices = array(
'getSomeProperty' => array(
\Neos\Flow\Aop\Advice\AroundAdvice::class => array(
new \Neos\Flow\Aop\Advice\AroundAdvice(\Neos\Foo\SomeAspect::class, 'aroundAdvice', \Neos\Flow\Core\Bootstrap::$staticObjectManager, function() { ... }),
),
),
);


@param array $methodsAndGroupedAdvices An array of method names and grouped advice objects
@return string PHP code for the content of an array of target method names and advice objects
@see buildProxyClass()
Creates code for an array of target methods and their advices .