Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass' => 'Symfony\Component\Serializer\DependencyInjection\SerializerPass',
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass' => 'Symfony\Component\Form\DependencyInjection\FormPass',
'Symfony\Bundle\FrameworkBundle\EventListener\SessionListener' => 'Symfony\Component\HttpKernel\EventListener\SessionListener',
'Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListenr' => 'Symfony\Component\HttpKernel\EventListener\TestSessionListener',
'Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener' => 'Symfony\Component\HttpKernel\EventListener\TestSessionListener',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm.., I recall we have typo rename class in the pass on purpose to apply before vs after, but can't remember where ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samsonasik Here is a method rename due to a typo:

But I guess for this change, the relevant change was from Symfony\Bundle\FrameworkBundleto Symfony\Component\HttpKernel. And the class was already correctly called so in 2011: symfony/symfony@839c332

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 👍

'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass' => 'Symfony\Component\Config\DependencyInjection\ConfigCachePass',
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass' => 'Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [
'Symfony\Component\DependencyInjection\Loader\Configuraton\inline' => 'Symfony\Component\DependencyInjection\Loader\Configuraton\inline_service',
'Symfony\Component\DependencyInjection\Loader\Configuraton\ref' => 'Symfony\Component\DependencyInjection\Loader\Configuraton\service',
'Symfony\Component\DependencyInjection\Loader\Configurator\inline' => 'Symfony\Component\DependencyInjection\Loader\Configurator\inline_service',
'Symfony\Component\DependencyInjection\Loader\Configurator\ref' => 'Symfony\Component\DependencyInjection\Loader\Configurator\service',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See e.g. https://github.com/symfony/dependency-injection/blob/5.1/Loader/Configurator/ContainerConfigurator.php#L90 that it does not appear that Symfony ever had this typo in their namespace here.

]);

$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

class RemoveTemplateAnnotatoinController extends AbstractController
class RemoveTemplateAnnotationController extends AbstractController
{
/**
* @Template()
Expand All @@ -27,7 +27,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

class RemoveTemplateAnnotatoinController extends AbstractController
class RemoveTemplateAnnotationController extends AbstractController
{
public function indexAction(): \Symfony\Component\HttpFoundation\Response
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rector\Symfony\CodeQuality\Rector\Class_\EventListenerToEventSubscriberRector;

return static function (RectorConfig $rectorConfig): void {
// wtf: all test have to be in single file due to autoloading race-condigition and container creating issue of fixture
// wtf: all test have to be in single file due to autoloading race condition and container creating issue of fixture
$rectorConfig->symfonyContainerXml(__DIR__ . '/listener_services.xml');
$rectorConfig->rule(EventListenerToEventSubscriberRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Symfony\Component\Validator\Constraints\Url;

function constraintUrlOptionRector()
{
$containt = new Url(['checkDNS' => true]);
$constraint = new Url(['checkDNS' => true]);
}

?>
Expand All @@ -19,7 +19,7 @@ use Symfony\Component\Validator\Constraints\Url;

function constraintUrlOptionRector()
{
$containt = new Url(['checkDNS' => \Symfony\Component\Validator\Constraints\Url::CHECK_DNS_TYPE_ANY]);
$constraint = new Url(['checkDNS' => \Symfony\Component\Validator\Constraints\Url::CHECK_DNS_TYPE_ANY]);
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace Rector\Symfony\Tests\Symfony40\Rector\ConstFetch\ConstraintUrlOptionRe

function constraintUrlOptionRector()
{
$containt = new Url(['checkDNS' => true]);
$constraint = new Url(['checkDNS' => true]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use Symfony\Component\Console\Output\ConsoleOutput;

function stringToArgumentArray2()
{
$procesHelper = new ProcessHelper();
$processHelper = new ProcessHelper();
$output = new ConsoleOutput();

$procesHelper->run($output, 'ls -l');
$processHelper->run($output, 'ls -l');
}

?>
Expand All @@ -24,10 +24,10 @@ use Symfony\Component\Console\Output\ConsoleOutput;

function stringToArgumentArray2()
{
$procesHelper = new ProcessHelper();
$processHelper = new ProcessHelper();
$output = new ConsoleOutput();

$procesHelper->run($output, ['ls', '-l']);
$processHelper->run($output, ['ls', '-l']);
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class SomeClass
{
public function run(EventDispatcherInterface $eventDisptacher)
public function run(EventDispatcherInterface $eventDispatcher)
{
$eventDisptacher->dispatch('event_name', new Event());
$eventDispatcher->dispatch('event_name', new Event());

$eventDisptacher->dispatch(new Event(), 'event_name');
$eventDispatcher->dispatch(new Event(), 'event_name');
}
}

Expand All @@ -24,11 +24,11 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class SomeClass
{
public function run(EventDispatcherInterface $eventDisptacher)
public function run(EventDispatcherInterface $eventDispatcher)
{
$eventDisptacher->dispatch(new Event(), 'event_name');
$eventDispatcher->dispatch(new Event(), 'event_name');

$eventDisptacher->dispatch(new Event(), 'event_name');
$eventDispatcher->dispatch(new Event(), 'event_name');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Symfony\Component\Form\FormBuilderInterface;

trait FormTraitDataMappter
trait FormTraitDataMapper
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Symfony\Tests\Symfony52\Rector\MethodCall\ValidatorBuilderEnabl

use Symfony\Component\Validator\ValidatorBuilder;

class SkipNotEnableAnnotatinoMapping
class SkipNotEnableAnnotationMapping
{
public function run(ValidatorBuilder $builder)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceTo

use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

abstract class OnlyRemoveInterfaceFromAbstactClass implements MessageHandlerInterface
abstract class OnlyRemoveInterfaceFromAbstractClass implements MessageHandlerInterface
{
}

Expand All @@ -16,7 +16,7 @@ namespace Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceTo

use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

abstract class OnlyRemoveInterfaceFromAbstactClass
abstract class OnlyRemoveInterfaceFromAbstractClass
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Narrow #[Security] attribute with inner sigle "is_granted/has_role" condition string to #[IsGranted] attribute',
'Narrow #[Security] attribute with inner single "is_granted/has_role" condition string to #[IsGranted] attribute',
[
new CodeSample(
<<<'CODE_SAMPLE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private function resolveParameterPosition(ArrayItem $arrayItem, int $key): int
return $this->valueResolver->getValue($arrayItem->key);
}

// fallbakc in case of empty array item
// fallback in case of empty array item
return $key;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public function decorate(Class_ $class): void
return;
}

$constuctClassMethod = $class->getMethod(MethodName::CONSTRUCT);
if (! $constuctClassMethod instanceof ClassMethod) {
$constructClassMethod = $class->getMethod(MethodName::CONSTRUCT);
if (! $constructClassMethod instanceof ClassMethod) {
return;
}

// empty stmts? add parent::__construct() to setup command
if ((array) $constuctClassMethod->stmts === []) {
if ((array) $constructClassMethod->stmts === []) {
$parentConstructStaticCall = new StaticCall(new Name('parent'), '__construct');
$constuctClassMethod->stmts[] = new Expression($parentConstructStaticCall);
$constructClassMethod->stmts[] = new Expression($parentConstructStaticCall);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private function createParentStaticCall(string $method): Expression
}

/**
* Looks for "parent::<methodName>
* Looks for "parent::<methodName>"
*/
private function hasParentCallOfMethod(ClassMethod $classMethod, string $method): bool
{
Expand Down
2 changes: 1 addition & 1 deletion rules/Symfony73/GetMethodToAsTwigAttributeTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function transformClassGetMethodToAttributeMarker(
$this->decorateMethodWithAttribute($localMethod, $attributeClass, $nameArg);
$this->visibilityManipulator->makePublic($localMethod);

// remove old new fuction instance
// remove old new function instance
unset($returnArray->items[$key]);

$hasChanged = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function processNewInstance(MethodCall $methodCall, int $position, int $o
return null;
}

// better skip and ahndle manualyl
if ($argValue instanceof Variable && $this->isVariableOfTypeWithRequiredConstructorParmaeters($argValue)) {
// better skip and handle manually
if ($argValue instanceof Variable && $this->isVariableOfTypeWithRequiredConstructorParameters($argValue)) {
return null;
}

Expand All @@ -67,7 +67,7 @@ public function processNewInstance(MethodCall $methodCall, int $position, int $o
return $methodCall;
}

private function isVariableOfTypeWithRequiredConstructorParmaeters(Variable $variable): bool
private function isVariableOfTypeWithRequiredConstructorParameters(Variable $variable): bool
{
// if form type is object with constructor args, handle manually
$variableType = $this->nodeTypeResolver->getType($variable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

class ReplaceDepricatedInterfacesSerializer implements DenormalizerInterface, NormalizerInterface, ContextAwareNormalizerInterface, ContextAwareDenormalizerInterface
class ReplaceDeprecatedInterfacesSerializer implements DenormalizerInterface, NormalizerInterface, ContextAwareNormalizerInterface, ContextAwareDenormalizerInterface
{
}

Expand All @@ -22,7 +22,7 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

class ReplaceDepricatedInterfacesSerializer implements DenormalizerInterface, NormalizerInterface
class ReplaceDeprecatedInterfacesSerializer implements DenormalizerInterface, NormalizerInterface
{
}

Expand Down