Skip to content
Closed
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
@@ -0,0 +1,23 @@
<?php

namespace Rector\Symfony\Tests\Symfony73\Rector\Class_\GetFunctionsToAsTwigFunctionAttributeRector\Fixture;

use Twig\Extension\AbstractExtension;

final class SkipDifferentClass extends AbstractExtension
{
public function getFunctions(): array
{
return [
new \Twig\TwigFunction('some_function', [DifferentClass::class, 'someFunction']),
new \Twig\TwigFunction('some_function', $this->someFunction(...)),
Copy link
Member

Choose a reason for hiding this comment

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

this part is fine, the one that skipped is Different::class

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, as not all changed, this should be skipped.

];
}

public function someFunction($value)
{
return $value;
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ final class SomeGetFunctions extends AbstractExtension

namespace Rector\Symfony\Tests\Symfony73\Rector\Class_\GetFunctionsToAsTwigFunctionAttributeRector\Fixture;

use Twig\Extension\AbstractExtension;

final class SomeGetFunctions extends AbstractExtension
final class SomeGetFunctions
{
#[\Twig\Attribute\AsTwigFunction('some_function')]
public function someFunction($value)
Expand Down
Loading