Skip to content
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

Merged
merged 17 commits into from
Mar 5, 2023
Merged

Upgrade to Symfony 6 #65

merged 17 commits into from
Mar 5, 2023

Conversation

kylekatarnls
Copy link
Member

@kylekatarnls kylekatarnls commented Jan 21, 2023

Fix #64
Fix #62

* @var PugSymfonyEngine
*/
protected $pugSymfonyEngine;
protected PugSymfonyEngine $pugSymfonyEngine;
Copy link

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;
Copy link

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) {
Copy link

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;
Copy link

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;
Copy link

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 {
Copy link

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;
Copy link

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,
) {
Copy link

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()
Copy link

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),
Copy link

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
Copy link

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());
Copy link

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());
Copy link

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);
Copy link

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');
Copy link

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',
Copy link

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'));
Copy link

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'));
Copy link

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,
Copy link

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,
Copy link

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.

@@ -278,10 +284,31 @@ public function getRenderArguments(string $name, array $locals): array
return [$event->getName(), $this->getParameters($event->getLocals())];
}

public function renderResponse(
Copy link

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
Copy link

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
Copy link

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(
Copy link

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),
Copy link

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

return $container->get($interceptorClass);
}, $this->userOptions['interceptors'] ?? []);
$interceptors = array_map(
static fn (string $interceptorClass) => $container->get($interceptorClass),
Copy link

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));
Copy link

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,
Copy link

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)
Copy link

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
Copy link

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),
Copy link

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 {
Copy link

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,
Copy link

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,
Copy link

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,
Copy link

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,
Copy link

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

@codeclimate
Copy link

codeclimate bot commented Mar 5, 2023

Code Climate has analyzed commit 74451b1 and detected 43 issues on this pull request.

Here's the issue category breakdown:

Category Count
Clarity 5
Style 12
Bug Risk 26

Note: there are 19 critical issues.

View more on Code Climate.

@kylekatarnls kylekatarnls marked this pull request as ready for review March 5, 2023 18:19
@kylekatarnls kylekatarnls merged commit b8fea34 into master Mar 5, 2023
@kylekatarnls kylekatarnls deleted the feature/symfony-6 branch March 5, 2023 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symfony 6.1 Support Error Pug\Symfony\CssExtension
1 participant