@param Container $app

@return \Ray\Aop\Pointcut
340588
public function configure(Container $app): Pointcut
    {
        $interceptor = new QueryLogInterceptor;
        $interceptor->setLogger($app['Psr\Log\LoggerInterface']);
        $interceptor->setDispatcher($app['Illuminate\Contracts\Events\Dispatcher']);
        $this->setInterceptor($interceptor);

        return $this->withAnnotatedAnyInterceptor();
    }
804810
public function boot(Container $app)
    {
        $app->afterResolving(function (BladeCompiler $compiler, $app) {

            $this->allowHighlightTag($compiler);

        });
    }
49510
protected function createDotenv($app)
    {
        return Dotenv::create(
            $app->environmentPath(),
            $app->environmentFile(),
            new DotenvFactory([new EnvConstAdapter, new ServerConstAdapter, new PutenvAdapter])
        );
    }
1282589
public function registerAutoPresenter(Container $app)
    {
        $app->singleton('autopresenter', function (Container $app) {
            $autoPresenter = new AutoPresenter();

            $autoPresenter->register(new AtomDecorator($autoPresenter, $app));
            $autoPresenter->register(new ArrayDecorator($autoPresenter));
            $autoPresenter->register(new PaginatorDecorator($autoPresenter));

            return $autoPresenter;
        });

        $app->alias('autopresenter', AutoPresenter::class);
    }
1208131
protected function getConfigurationFiles(Container $app)
    {
        $files = [];
        $configPath = realpath($app['path.config']);

        /** @var \Symfony\Component\Finder\SplFileInfo $file */
        foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {
            $nesting = $this->getConfigurationNesting($file, $configPath);
            $files[$nesting . basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        return $files;
    }
308621
public function setInstance(Container $app)
    {
        $app->instance('app', $app);
        $app->instance(Container::class, $app);

        if ($this->framework === 'lumen') {
            $app->instance(LumenApplication::class, $app);
        }

        Container::setInstance($app);
        Context::setApp($app);
        Facade::clearResolvedInstances();
        Facade::setFacadeApplication($app);
    }
85487
protected function getProviderHandler(Container $app, $prefix)
    {
        return function () use ($app, $prefix) {
            $initializer = $app["$prefix.client_initializer"];

            return $initializer($app);
        };
    }
707521
public function app($app)
    {
        $this->classRoute = Router::$defaultNameSpace . $app;
        
        $request = Router::$requestDriver;
        if (!empty($request)) {
            if (!$request->query->get("q")) {
                $request->query->set("q", "/");
            }
        } else {
            $_GET['q'] = "/";
        }
        
        if ($this->method === "ALL" ||
            ((!empty($request) && $this->method === $request->server->get("REQUEST_METHOD")) ||
                $_SERVER['REQUEST_METHOD'] === $this->method)
        ) {
            $this->useRoute($this->route);
        } else {
            $this->classRoute = false;
        }
        
        return new RouteMiddleware($this->route, $this->classRoute, $this->methodRoute);
    }
12388
protected function getOption(Container $app, $name)
    {
        if (isset($app['silex_user.options'][$name])) {
            return $app['silex_user.options'][$name];
        } else {
            return self::$defaultOptions[$name];
        }
    }
74301
public function register(Container $app)
    {
        $this->kernel                        = $app;
        $app['request_matcher']              = $app->extend(
            'request_matcher',
            function ($urlMatcher, $c) {
                $context = $c['request_context'];
                
                $newMatcher = new GroupUrlMatcher(
                    $context,
                    [
                        new CacheableRouterUrlMatcherWrapper(
                            $this->getRouter($context)->getMatcher(),
                            $c['routing.config.namespaces']
                        ),
                        $urlMatcher,
                    ]
                );
                
                return $newMatcher;
            }
        );
        $app['url_generator']                = $app->extend(
            'url_generator',
            function ($generator, $kernel) {
                /** @var SilexKernel $kernel */
                
                /** @var RequestContext $context */
                //$context = $kernel['request_context'];
                /** @var Router $router */
                $router       = $kernel['router'];
                $newGenerator = $router->getGenerator();
                
                //$newGenerator = new UrlGenerator($router->getRouteCollection(), $context);
                
                return new GroupUrlGenerator(
                    [
                        $newGenerator,
                        $generator,
                    ]
                );
            }
        );
        $app['router']                       = function ($app) {
            return $this->getRouter($app['request_context']);
        };
        $app['routing.config.data_provider'] = function ($app) {
            $routingConfig = $app['routing.config'];
            
            return $this->processConfiguration(
                $routingConfig,
                new CacheableRouterConfiguration()
            );
        };
        $app['routing.config.namespaces']    = function () {
            return $this->getConfigDataProvider()->getOptional(
                'namespaces',
                DataProviderInterface::ARRAY_TYPE,
                []
            );
        };
        $app['routing.config.cache_dir']     = function () {
            return $this->getConfigDataProvider()->getOptional('cache_dir');
        };
    }
64690
public static function getClassForKey($key, App $app)
    {
        $className = '\\app\\statistics\\metrics\\'.Inflector::get()->camelize($key).'Metric';

        if (class_exists($className)) {
            return new $className($app);
        }

        return false;
    }
962975
public function bindIlluminateView(Container $app = null, array $viewPaths = array(), $cachePath)
    {
        if (! $app) {
            $app = new Container();
        }

        $this->ensureIlluminateBase($app);

        $app->bindShared('view.engine.resolver', function (Container $app) {
            $resolver = new EngineResolver;

            $resolver->register('php', function () {
                return new PhpEngine;
            });

            $app->bindShared('blade.compiler', function (Container $app) {
                $cache = $this->illuminateCachePath;

                return new BladeCompiler($app['files'], $cache);
            });

            $resolver->register('blade', function () use ($app) {
                return new CompilerEngine($app['blade.compiler'], $app['files']);
            });

            return $resolver;
        });

        $app->bindShared('view.finder', function (Container $app) {
            $paths = $this->illuminateViewPaths;

            return new FileViewFinder($app['files'], $paths);
        });

        $app->bindShared('view', function (Container $app) {
            $env = new ViewFactory($app['view.engine.resolver'], $app['view.finder'], $app['events']);

            $env->setContainer($app);

            return $env;
        });

        return $app;
    }
312065
public function register(Container $app)
    {
        $routerContainer = new RouterContainer();
        $app[Map::class] = $routerContainer->getMap();
        $app[RuleIterator::class] = $routerContainer->getRuleIterator();
    }
749068
protected function addCommands(Application $application, ContainerBuilder $container)
    {
        $commands = array_keys($container->findTaggedServiceIds('command'));
        foreach ($commands as $id) {
            /** @var \Symfony\Component\Console\Command\Command|ContainerAwareInterface $command */
            $command = $container->get($id);
            $application->add($command);
            if ($command instanceof ContainerAwareInterface) {
                $command->setContainer($container);
            }
        }

        return $application;
    }
1021582
public static function endpointsInfo(Application $app)
    {
        $app->boot();

        /** @var ControllerCollection $controllers */
        $controllers = $app['controllers'];
        $rControllers = new ReflectionObject($controllers);
        $pControllers = $rControllers->getProperty('controllers');
        $pControllers->setAccessible(true);

        /** @var Controller $ctrl */
        foreach ($pControllers->getValue($controllers) as $ctrl) {
            if ($ctrl instanceof Controller) {
                $route = $ctrl->getRoute();

                foreach ($route->getMethods() as $method) {
                    echo '- ' . str_pad($method, 7) . ' ' . str_pad($route->getPath(), 70);

                    if ($service = $route->getDefault('_controller')) {
                        if (is_scalar($service)) {
                            echo 'Handler: ' . $service;
                        }
                    }

                    echo "\n";
                }
            }
        }
    }
923484
public function register(Container $app)
    {
        $app[ResponseInterface::class]
            = $app->factory(Response::class);

        $app[ServerRequestInterface::class] = function () use ($app) {
            // Return changed request if available
            if (isset($app->request)) {
                return $app->request;
            }
            return ServerRequestFactory::fromGlobals();
        };
    }
537656
public function register(Container $app)
    {
        $app["slaxer.service"] = function (Container $app) {
            $cliApp = new CLIApp("Slaxer", "0.4.*-dev");

            if (isset($app["slaxerCommands"]) === false) {
                return $cliApp;
            }

            foreach ($app["slaxerCommands"] as $key => $value) {
                $params = [];
                if (is_int($key)) {
                    $command = $value;
                } else {
                    $command = $key;
                    if (is_string($value)) {
                        $value = [$value];
                    }
                    foreach ($value as $service) {
                        $params[] = $app[$service];
                    }
                }

                $cmd = new $command($app["logger.service"]("Slaxer"));
                if (method_exists($cmd, "init")) {
                    $cmd->init(...$params);
                }
                $cliApp->add($cmd);
            }

            return $cliApp;
        };
    }