-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Symfony 6 #65
Conversation
* @var PugSymfonyEngine | ||
*/ | ||
protected $pugSymfonyEngine; | ||
protected PugSymfonyEngine $pugSymfonyEngine; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected 'PugSymfonyEngine' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
|
||
trait PugRenderer | ||
{ | ||
protected PugSymfonyEngine $pug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected 'PugSymfonyEngine' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
|
||
return $propertyAccessor->getValue($object); | ||
return $propertyAccessor->getValue($object); | ||
} catch (ReflectionException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected ')', expecting '|' or variable (T_VARIABLE)
return method_exists($pug, 'hasOption') && !$pug->hasOption($name) | ||
? $default | ||
: $pug->getOption($name); | ||
return $pug->hasOption($name) ? $pug->getOption($name) : $default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method hasOption
from undeclared class \Pug\Pug
return method_exists($pug, 'hasOption') && !$pug->hasOption($name) | ||
? $default | ||
: $pug->getOption($name); | ||
return $pug->hasOption($name) ? $pug->getOption($name) : $default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method getOption
from undeclared class \Pug\Pug
string $bundleClass, | ||
callable $proceedTask, | ||
int &$flags, | ||
): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected ')', expecting variable (T_VARIABLE)
* @var ContainerInterface | ||
*/ | ||
protected $container; | ||
protected ContainerInterface $container; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected 'ContainerInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
public function __construct( | ||
KernelInterface $kernel, | ||
TwigEnvironment $twig, | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected ')', expecting variable (T_VARIABLE)
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
return static function (ContainerConfigurator $configurator): void { | ||
$services = $configurator->services() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method services
from undeclared class \Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
]); | ||
} | ||
$application->addCommands([ | ||
$this->container->get(AssetsPublishCommand::class), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference to constant class
from undeclared class \Pug\PugSymfonyBundle\Command\AssetsPublishCommand
* @author Fabien Potencier <fabien@symfony.com> | ||
* @author Jeremy Mikola <jmikola@gmail.com> | ||
*/ | ||
class PugExtension extends Extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class extends undeclared class \Symfony\Component\HttpKernel\DependencyInjection\Extension
} | ||
$extension = new PugExtension(); | ||
$containerBuilder->registerExtension($extension); | ||
$containerBuilder->loadFromExtension($extension->getAlias()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to undeclared method \Pug\PugSymfonyBundle\PugExtension::getAlias
} | ||
$extension = new PugExtension(); | ||
$containerBuilder->registerExtension($extension); | ||
$containerBuilder->loadFromExtension($extension->getAlias()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method loadFromExtension
from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
$propertyAccessor->setValue($container, $services); | ||
} | ||
$extension = new PugExtension(); | ||
$containerBuilder->registerExtension($extension); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method registerExtension
from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/config')); | ||
$loader->load('pug.php'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method load
from undeclared class \Symfony\Component\DependencyInjection\Loader\PhpFileLoader
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Throwable; | ||
|
||
#[AsCommand( | ||
'assets:publish', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected ','
{ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/config')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method __construct
from undeclared class \Symfony\Component\DependencyInjection\Loader\PhpFileLoader
{ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/config')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to method __construct
from undeclared class \Symfony\Component\Config\FileLocator
})); | ||
$options['paths'] = array_unique(array_filter( | ||
$options['viewDirectories'], | ||
static fn ($path) => $path !== $baseDir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 12 spaces, found 16
protected static function installSymfonyBundle(IOInterface $io, $dir, $bundle, $bundleClass, $proceedTask, &$flags) | ||
{ | ||
protected static function installSymfonyBundle( | ||
IOInterface $io, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid variables with short names like $io. Configured minimum length is 3.
7c9ceab
to
372f227
Compare
@@ -278,10 +284,31 @@ public function getRenderArguments(string $name, array $locals): array | |||
return [$event->getName(), $this->getParameters($event->getLocals())]; | |||
} | |||
|
|||
public function renderResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function renderResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
{ | ||
return is_array($token) ? $token[1] : $token; | ||
} | ||
|
||
protected function pushArgument(array &$arguments, string &$argument, bool &$argumentNeedInterpolation) | ||
protected function pushArgument(array &$arguments, string &$argument, bool &$argumentNeedInterpolation): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid excessively long variable names like $argumentNeedInterpolation. Keep variable name length under 20.
@@ -11,13 +13,19 @@ | |||
*/ | |||
trait Installer | |||
{ | |||
protected static function askConfirmation(IOInterface $io, $message) | |||
protected static function askConfirmation(IOInterface $io, string $message): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid variables with short names like $io. Configured minimum length is 3.
{ | ||
return !$io->isInteractive() || $io->askConfirmation($message); | ||
} | ||
|
||
protected static function installSymfonyBundle(IOInterface $io, $dir, $bundle, $bundleClass, $proceedTask, &$flags) | ||
{ | ||
protected static function installSymfonyBundle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove error control operator '@' on line 30.
return $container->get($interceptorClass); | ||
}, $this->userOptions['interceptors'] ?? []); | ||
$interceptors = array_map( | ||
static fn (string $interceptorClass) => $container->get($interceptorClass), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 12 spaces, found 16
372f227
to
0fa499d
Compare
return $container->get($interceptorClass); | ||
}, $this->userOptions['interceptors'] ?? []); | ||
$interceptors = array_map( | ||
static fn (string $interceptorClass) => $container->get($interceptorClass), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before opening parenthesis of function call prohibited
return array_unique(array_map(function ($path) { | ||
return realpath($path) ?: $path; | ||
}, $paths)); | ||
return array_unique(array_map(static fn ($path) => realpath($path) ?: $path, $paths)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before opening parenthesis of function call prohibited
})); | ||
$options['paths'] = array_unique(array_filter( | ||
$options['viewDirectories'], | ||
static fn ($path) => $path !== $baseDir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before opening parenthesis of function call prohibited
*/ | ||
class PugExtension extends Extension | ||
{ | ||
public function load(array $configs, ContainerBuilder $container) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter $container
has undeclared type \Symfony\Component\DependencyInjection\ContainerBuilder
* @throws ReflectionException | ||
*/ | ||
public function setContainer(ContainerInterface $container = null) | ||
public function build(ContainerBuilder $containerBuilder): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter $containerBuilder
has undeclared type \Symfony\Component\DependencyInjection\ContainerBuilder
]); | ||
} | ||
$application->addCommands([ | ||
$this->container->get(AssetsPublishCommand::class), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference to undeclared property \Pug\PugSymfonyBundle\PugSymfonyBundle->container
|
||
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
return static function (ContainerConfigurator $configurator): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter $configurator
has undeclared type \Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
public function __construct(KernelInterface $kernel) | ||
{ | ||
public function __construct( | ||
protected readonly KernelInterface $kernel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE)
protected readonly KernelInterface $kernel, | ||
TwigEnvironment $twig, | ||
private readonly ?RequestStack $stack = null, | ||
private readonly ?RequestContext $context = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 4 spaces, found 8
public function __construct( | ||
protected readonly KernelInterface $kernel, | ||
TwigEnvironment $twig, | ||
private readonly ?RequestStack $stack = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 4 spaces, found 8
public function __construct(KernelInterface $kernel) | ||
{ | ||
public function __construct( | ||
protected readonly KernelInterface $kernel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 4 spaces, found 8
6a5581c
to
5395257
Compare
Code Climate has analyzed commit 74451b1 and detected 43 issues on this pull request. Here's the issue category breakdown:
Note: there are 19 critical issues. View more on Code Climate. |
Fix #64
Fix #62