Update dependency rector/rector to ^2.5.6#357
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
=======================================
Coverage 97.00% 97.00%
=======================================
Files 6 6
Lines 501 501
=======================================
Hits 486 486
Misses 15 15 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.5.5→^2.5.6Release Notes
rectorphp/rector (rector/rector)
v2.5.6: Released Rector 2.5.6Compare Source
New Features 🥳
RemoveReturnTagIncompatibleWithNativeTypeRector(#8172)final class SomeClass { - /** - * @​return SomeObject - */ public function getName(): string { return $this->someObject->getName(); } }MergePhpstanDocTagIntoNativeRectorto merge@phpstan-*doc tags into native tags (#8171)final class SomeClass { /** - * @​var Collection - * - * @​phpstan-var Collection<int, string> + * @​var Collection<int, string> */ private $items; }Bugfixes 🐛
NullToStrictStringFuncCallArgRector(#8164)getRuleDefinition()method, parts 1–5 (#8165, #8166, #8167, #8168, #8169)phpstan/phpdoc-parserto^2.3.3(#8174)PHPUnit 🧪
New rules and changes from rector-phpunit.
New Rules
AssertClassToThisAssertRector(#707)use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; final class SomeClass extends TestCase { public function run() { - Assert::assertEquals('expected', $result); + $this->assertEquals('expected', $result); } }BareCreateMockAssignToDirectUseRector— inline a single-usecreateMock()assignment (#708)final class SomeTest extends TestCase { public function test() { - $someObject = $this->createMock(SomeClass::class); - $this->process($someObject); + $this->process($this->createMock(SomeClass::class)); } private function process(SomeClass $someObject): void { } }WillReturnCallbackFallbackToThrowRector— throw on an unexpected extra consecutive call (#710)$this->someServiceMock->expects($matcher) ->method('run') ->willReturnCallback(function () use ($matcher) { if ($matcher->numberOfInvocations() === 1) { return 1; } + + throw new \PHPUnit\Framework\Exception(sprintf('Method should not be called for the %dth time', $matcher->numberOfInvocations())); });RemoveReturnFromVoidMethodMockCallbackRector— type a void mock callback and drop its value return (#711)$this->createMock(SomeClass::class) ->method('run') - ->willReturnCallback(function ($arg) { + ->willReturnCallback(function ($arg): void { echo $arg; - - return true; });(
SomeClass::run()returnsvoid.)CallbackSingleAssertToSimplerRector— collapse awith()callback with a soleassertSame()toequalTo()(#714)$builder->expects($this->exactly(2)) ->method('add') - ->with($this->callback(function ($type): bool { - $this->assertSame(TextType::class, $type); - - return true; - })); + ->with($this->equalTo(TextType::class));Improvements
TestCasesuffix classes inRemoveNeverUsedMockPropertyRector(#709)WithCallbackIdenticalToStandaloneAssertsRector(#712)return throwandreturn nullin void mock callbacks (#713)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.