mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-22 05:33:34 +02:00
Applied automated coding standard fixes
This commit is contained in:
@@ -11,8 +11,7 @@ class AppManager
|
||||
/** Create a new AppManager object. */
|
||||
public function __construct(
|
||||
private Container $container
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Setup and configure the application. */
|
||||
public function __invoke(): App
|
||||
|
@@ -12,8 +12,7 @@ class ExceptionManager
|
||||
public function __construct(
|
||||
private App $app,
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Set up and configure exception handling. */
|
||||
public function __invoke(): void
|
||||
|
@@ -11,8 +11,7 @@ class MiddlewareManager
|
||||
public function __construct(
|
||||
private App $app,
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Register application middlewares. */
|
||||
public function __invoke(): void
|
||||
|
@@ -10,8 +10,7 @@ class RouteManager
|
||||
/** Create a new RouteManager object. */
|
||||
public function __construct(
|
||||
private App $app
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Register the application routes. */
|
||||
public function __invoke(): void
|
||||
|
@@ -10,8 +10,7 @@ class Config
|
||||
/** Create a new Config object. */
|
||||
public function __construct(
|
||||
private Container $container
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Get the value of a configuration variable.
|
||||
|
@@ -20,8 +20,7 @@ class DirectoryController
|
||||
private Finder $finder,
|
||||
private Twig $view,
|
||||
private TranslatorInterface $translator
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the IndexController. */
|
||||
public function __invoke(Request $request, Response $response): ResponseInterface
|
||||
|
@@ -17,8 +17,7 @@ class FileInfoController
|
||||
private Config $config,
|
||||
private CacheInterface $cache,
|
||||
private TranslatorInterface $translator
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the FileInfoHandler. */
|
||||
public function __invoke(Request $request, Response $response): ResponseInterface
|
||||
|
@@ -12,8 +12,7 @@ class IndexController
|
||||
/** Create a new IndexController object. */
|
||||
public function __construct(
|
||||
private Container $container
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the IndexController. */
|
||||
public function __invoke(Request $request, Response $response): ResponseInterface
|
||||
|
@@ -16,8 +16,7 @@ class SearchController
|
||||
private Finder $finder,
|
||||
private Twig $view,
|
||||
private TranslatorInterface $translator
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the SearchHandler. */
|
||||
public function __invoke(Request $request, Response $response): ResponseInterface
|
||||
|
@@ -22,8 +22,7 @@ class ZipController
|
||||
private CacheInterface $cache,
|
||||
private Finder $finder,
|
||||
private TranslatorInterface $translator
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the ZipHandler. */
|
||||
public function __invoke(Request $request, Response $response): ResponseInterface
|
||||
|
@@ -16,8 +16,7 @@ class ErrorHandler implements ErrorHandlerInterface
|
||||
public function __construct(
|
||||
private Twig $view,
|
||||
private TranslatorInterface $translator
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the ErrorHandler class. */
|
||||
public function __invoke(
|
||||
|
@@ -27,8 +27,7 @@ class CacheFactory
|
||||
public function __construct(
|
||||
private Container $container,
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Initialize and return a CacheInterface. */
|
||||
public function __invoke(): CacheInterface
|
||||
|
@@ -22,8 +22,7 @@ class FinderFactory
|
||||
private Container $container,
|
||||
private Config $config,
|
||||
private HiddenFiles $hiddenFiles
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Initialize and return the Finder component. */
|
||||
public function __invoke(): Finder
|
||||
|
@@ -17,8 +17,7 @@ class TranslationFactory
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private CacheInterface $cache
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Initialize and return the translation component. */
|
||||
public function __invoke(): TranslatorInterface
|
||||
@@ -31,7 +30,7 @@ class TranslationFactory
|
||||
}
|
||||
|
||||
$translator = new Translator($language);
|
||||
$translator->addLoader('yaml', new YamlFileLoader());
|
||||
$translator->addLoader('yaml', new YamlFileLoader);
|
||||
|
||||
foreach ($translations as $language) {
|
||||
$translator->addResource('yaml', sprintf(
|
||||
|
@@ -16,8 +16,7 @@ class TwigFactory
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private CallableResolver $callableResolver
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Initialize and return the Twig component. */
|
||||
public function __invoke(): Twig
|
||||
|
@@ -12,8 +12,7 @@ class CacheControlMiddleware
|
||||
/** Create a new CacheControlMiddleware object. */
|
||||
public function __construct(
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the CacheControlMiddleware class. */
|
||||
public function __invoke(Request $request, RequestHandler $handler): ResponseInterface
|
||||
|
@@ -15,8 +15,7 @@ class PruneCacheMiddleware
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private CacheInterface $cache
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the CachePruneMiddleware class. */
|
||||
public function __invoke(Request $request, RequestHandler $handler): ResponseInterface
|
||||
|
@@ -14,8 +14,7 @@ class RegisterGlobalsMiddleware
|
||||
|
||||
public function __construct(
|
||||
private Twig $view
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the RegisterGlobalsMiddleware class. */
|
||||
public function __invoke(Request $request, RequestHandler $handler): ResponseInterface
|
||||
|
@@ -16,8 +16,7 @@ class WhoopsMiddleware
|
||||
private RunInterface $whoops,
|
||||
private PrettyPageHandler $pageHandler,
|
||||
private JsonResponseHandler $jsonHandler
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Invoke the WhoopseMiddleware class. */
|
||||
public function __invoke(Request $request, RequestHandler $handler): ResponseInterface
|
||||
|
@@ -12,8 +12,7 @@ class Asset extends ViewFunction
|
||||
/** Create a new Asset object. */
|
||||
public function __construct(
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Return the path to an asset. */
|
||||
public function __invoke(string $path): string
|
||||
|
@@ -14,8 +14,7 @@ class Breadcrumbs extends ViewFunction
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private string $directorySeparator = DIRECTORY_SEPARATOR
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Build a collection of breadcrumbs for a given path.
|
||||
|
@@ -11,8 +11,7 @@ class Config extends ViewFunction
|
||||
/** Create a new Config object. */
|
||||
public function __construct(
|
||||
private AppConfig $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Retrieve an item from the view config.
|
||||
|
@@ -12,8 +12,7 @@ class Icon extends ViewFunction
|
||||
/** Create a new Config object. */
|
||||
public function __construct(
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Retrieve the icon markup for a file. */
|
||||
public function __invoke(SplFileInfo $file): string
|
||||
|
@@ -12,8 +12,7 @@ class Markdown extends ViewFunction
|
||||
public function __construct(
|
||||
private ParsedownExtra $parser,
|
||||
private CacheInterface $cache
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Parses a string of markdown into HTML. */
|
||||
public function __invoke(string $string): string
|
||||
|
@@ -12,8 +12,7 @@ class ModifiedTime extends ViewFunction
|
||||
|
||||
public function __construct(
|
||||
private Config $config
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Get the modified time from a file object. */
|
||||
public function __invoke(SplFileInfo $file): string
|
||||
|
@@ -11,8 +11,7 @@ class ParentUrl extends ViewFunction
|
||||
/** Create a new ParentUrl object. */
|
||||
public function __construct(
|
||||
private string $directorySeparator = DIRECTORY_SEPARATOR
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Get the parent directory for a given path. */
|
||||
public function __invoke(string $path): string
|
||||
|
@@ -11,8 +11,7 @@ class Translate extends ViewFunction
|
||||
/** Create a new Translate object. */
|
||||
public function __construct(
|
||||
private TranslatorInterface $translator
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Retrieve a translated string by ID. */
|
||||
public function __invoke(string $id): string
|
||||
|
@@ -11,8 +11,7 @@ class Url extends ViewFunction
|
||||
/** Create a new Url object. */
|
||||
public function __construct(
|
||||
private string $directorySeparator = DIRECTORY_SEPARATOR
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/** Return the URL for a given path. */
|
||||
public function __invoke(string $path = '/'): string
|
||||
|
Reference in New Issue
Block a user