Applied automated coding standard fixes

This commit is contained in:
Chris Kankiewicz
2023-09-26 13:29:42 -07:00
parent d128c5fa6a
commit 1089c84873
28 changed files with 29 additions and 57 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -11,8 +11,7 @@ class MiddlewareManager
public function __construct(
private App $app,
private Config $config
) {
}
) {}
/** Register application middlewares. */
public function __invoke(): void

View File

@@ -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

View File

@@ -10,8 +10,7 @@ class Config
/** Create a new Config object. */
public function __construct(
private Container $container
) {
}
) {}
/**
* Get the value of a configuration variable.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -16,8 +16,7 @@ class ErrorHandler implements ErrorHandlerInterface
public function __construct(
private Twig $view,
private TranslatorInterface $translator
) {
}
) {}
/** Invoke the ErrorHandler class. */
public function __invoke(

View File

@@ -27,8 +27,7 @@ class CacheFactory
public function __construct(
private Container $container,
private Config $config
) {
}
) {}
/** Initialize and return a CacheInterface. */
public function __invoke(): CacheInterface

View File

@@ -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

View File

@@ -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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -14,8 +14,7 @@ class RegisterGlobalsMiddleware
public function __construct(
private Twig $view
) {
}
) {}
/** Invoke the RegisterGlobalsMiddleware class. */
public function __invoke(Request $request, RequestHandler $handler): ResponseInterface

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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