public function testFileContent() { echo '<pre>', htmlspecialchars(file_get_contents(__FILE__)), '</pre>'; }
break; case 'dynamic-interceptor': $aspectName = 'Demo\\Aspect\\DynamicMethodsAspect'; $example = new DynamicMethodsDemo(); $example->saveById(123); // intercept magic dynamic method $example->load(456); // notice, that advice for this magic method is not called DynamicMethodsDemo::find(array('id' => 124)); //intercept magic static method break; case 'function-interceptor': $aspectName = 'Demo\\Aspect\\FunctionInterceptorAspect'; $example = new FunctionDemo(); $example->testArrayFunctions(array('test' => 1, 'code' => 2, 'more' => 1)); $example->testFileContent(); break; case 'fluent-interface': $aspectName = 'Demo\\Aspect\\FluentInterfaceAspect'; $example = new UserFluentDemo(); // Original class doesn't provide fluent interface for us if ($example instanceof \Go\Aop\Proxy) { // This check is to prevent fatal errors when AOP is disabled $example->setName('John')->setSurname('Doe')->setPassword('root'); } else { echo "Fluent interface is not available without AOP", PHP_EOL; } break; case 'human-advices': $aspectName = 'Demo\\Aspect\\HealthyLiveAspect'; $example = new HumanDemo();