for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LunixREST\Endpoint;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
/**
* An EndpointFactory that assumes all created endpoints are LoggingEndpoints
* Class LoggingEndpointFactory
* @package LunixREST\Endpoint
*/
abstract class LoggingEndpointFactory implements EndpointFactory, LoggerAwareInterface
{
* @var LoggerInterface
protected $logger;
* LoggingEndpointFactory constructor.
* @param LoggerInterface $logger
public function __construct(LoggerInterface $logger)
$this->logger = $logger;
}
* @param string $name
* @param string $version
* @return Endpoint
public function getEndpoint(string $name, string $version): Endpoint
$endpoint = $this->getLoggingEndpoint($name, $version);
$endpoint->setLogger($this->logger);
return $endpoint;
* @return LoggingEndpoint
public abstract function getLoggingEndpoint(string $name, string $version): LoggingEndpoint;