예제 #1
0
 /**
  * @return LoggerInterface
  */
 private function getLogger() : LoggerInterface
 {
     if (!$this->logger) {
         $this->logger = LoggerFactory::getLogger(get_class($this));
     }
     return $this->logger;
 }
예제 #2
0
 /**
  * Returns a {@link \Psr\Log\LoggerInterface} logger implementation.
  */
 public function getLogger()
 {
     if (null === $this->logger) {
         $this->logger = LoggerFactory::getLogger(__CLASS__);
     }
     return $this->logger;
 }
예제 #3
0
 /**
  * Creates a new {@link \bitExpert\Adroit\AdroitMiddleware}.
  *
  * @param \bitExpert\Adroit\Action\Resolver\ActionResolver[] $actionResolvers
  * @param \bitExpert\Adroit\Responder\Resolver\ResponderResolver[] $responderResolvers
  * @param Router $router
  */
 public function __construct(array $actionResolvers, array $responderResolvers, Router $router)
 {
     $this->actionResolvers = $actionResolvers;
     $this->responderResolvers = $responderResolvers;
     $this->router = $router;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #4
0
 /**
  * Creates a new {@link \bitExpert\Adroit\Router\RegexRouter}.
  *
  * @param string $baseURL
  */
 public function __construct($baseURL)
 {
     // completes the base url with a / if not set in configuration
     $this->baseURL = rtrim($baseURL, '/') . '/';
     $this->defaultActionToken = null;
     $this->routes = [];
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #5
0
 /**
  * Creates a new {@link \bitExpert\Pathfinder\RegexRouter}.
  *
  * @param string $baseURL
  */
 public function __construct($baseURL)
 {
     // completes the base url with a / if not set in configuration
     $this->baseURL = rtrim($baseURL, '/') . '/';
     $this->defaultTarget = null;
     $this->targetRequestAttribute = self::DEFAULT_TARGET_REQUEST_ATTRIBUTE;
     $this->routes = [];
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #6
0
 /**
  * Creates a new {@link \bitExpert\AddItEasy\Cli\Command\ExportCommand}.
  *
  * @param Adrenaline $app
  * @param string $exportDir
  * @param string $dataDir
  * @param string $assetDir
  */
 public function __construct(Adrenaline $app, $exportDir, $dataDir, $assetDir)
 {
     parent::__construct('export');
     $this->setDescription('Runs the static site export process');
     $this->app = $app;
     $this->exportDir = realpath($exportDir);
     $this->dataDir = realpath($dataDir);
     $this->assetDir = realpath($assetDir);
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
 /**
  * @test
  */
 public function channelParamIsPassedToCallable()
 {
     $loggerMock = $this->getMock('\\Psr\\Log\\LoggerInterface');
     LoggerFactory::registerFactoryCallback(function ($channel) use($loggerMock) {
         $loggerMock->channel = $channel;
         return $loggerMock;
     });
     $logger = LoggerFactory::getLogger('test');
     $this->assertSame('test', $logger->channel);
 }
 /**
  * Creates a new {@link \bitExpert\AddItEasy\Http\Action\HandleDefaultPageAction}.
  *
  * @param string $basePath
  * @param string $defaultPage
  */
 public function __construct($basePath, $defaultPage)
 {
     $this->basePath = $basePath;
     $this->defaultPage = $defaultPage;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
 /**
  * Creates a new {@link \bitExpert\Http\Middleware\Psr7\Prophiler\ProphilerMiddleware}.
  *
  * @param Toolbar $toolbar
  */
 public function __construct(Toolbar $toolbar)
 {
     $this->toolbar = $toolbar;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #10
0
 /**
  * Creates a new {@link \bitExpert\AddItEasy\Http\Action\HandlePageAction}.
  *
  * @param $basePath
  */
 public function __construct($basePath)
 {
     $this->basePath = $basePath;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #11
0
 /**
  * Creates a new {@link \bitExpert\AddItEasy\Http\Middleware\PageNotFoundMiddleware}.
  */
 public function __construct()
 {
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #12
0
 /**
  * Creates a new {@link \bitExpert\Pathfinder\AbstractRouter}.
  *
  * @param Route[] routes
  * @throws \InvalidArgumentException
  * @throws \RuntimeException
  */
 public function __construct(array $routes = [])
 {
     $this->routes = [];
     $this->setRoutes($routes);
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #13
0
 /**
  * Creates a new {\bitExpert\AddItEasy\Http\Responder\TwigResponder}.
  *
  * @param \Twig_Environment $twig
  * @param array $siteParams key/value collection of default global variables
  */
 public function __construct(\Twig_Environment $twig, array $siteParams)
 {
     $this->twig = $twig;
     $this->siteParams = $siteParams;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
 /**
  * @param Resolver[] | Resolver $resolvers
  * @throws \InvalidArgumentException
  */
 public function __construct(array $resolvers)
 {
     $this->logger = LoggerFactory::getLogger(__CLASS__);
     $this->resolvers = $resolvers;
 }
예제 #15
0
 /**
  * Creates a new {@link \bitExpert\AddItEasy\Cli\Command\InitCommand}.
  */
 public function __construct()
 {
     parent::__construct('init');
     $this->setDescription('Creates initial filesystem layout for a new project');
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #16
0
 /**
  * Creates a new {@link \bitExpert\Adroit\Action\Resolver\ContainerAwareActionResolver}.
  *
  * @param ContainerInterface $container
  * @throws \RuntimeException
  */
 public function __construct(ContainerInterface $container)
 {
     $this->container = $container;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }
예제 #17
0
 /**
  * Creates a new {@link \bitExpert\AddItEasy\Twig\PageBlockProvider}.
  *
  * @param $basePath
  * @param Twig_Environment $twigEnv
  */
 public function __construct($basePath, Twig_Environment $twigEnv)
 {
     $this->basePath = $basePath;
     $this->twigEnv = $twigEnv;
     $this->logger = LoggerFactory::getLogger(__CLASS__);
 }