pug-php/pug-symfony

View on GitHub
src/Pug/PugSymfonyEngine.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 11 of 11 total issues

The class PugSymfonyEngine has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
Open

class PugSymfonyEngine implements EngineInterface, InstallerInterface
{
use Installer;
use HelpersHandler;
use Filters;
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpmd

Avoid assigning values to variables in if clauses and the like (line '121', column '17').
Open

protected function getFileFromName(string $name, string $directory = null): string
{
$parts = explode(':', $name);
 
if (count($parts) > 1) {
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpmd

syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE)
Open

protected readonly KernelInterface $kernel,
Severity: Critical
Found in src/Pug/PugSymfonyEngine.php by phan

Avoid excessively long variable names like $defaultTemplateDirectory. Keep variable name length under 20.
Open

protected $defaultTemplateDirectory;
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpmd

Line exceeds 120 characters; contains 122 characters
Open

$this->userOptions = ($this->container->hasParameter('pug') ? $this->container->getParameter('pug') : null) ?: [];
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer

Space before opening parenthesis of function call prohibited
Open

return array_unique(array_map(static fn ($path) => realpath($path) ?: $path, $paths));
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer

Space before opening parenthesis of function call prohibited
Open

static fn (string $interceptorClass) => $container->get($interceptorClass),
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

static fn (string $interceptorClass) => $container->get($interceptorClass),
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

protected readonly KernelInterface $kernel,
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

private readonly ?RequestStack $stack = null,
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

private readonly ?RequestContext $context = null,
Severity: Minor
Found in src/Pug/PugSymfonyEngine.php by phpcodesniffer
Category
Status