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

[Rector] Apply SetList::DEAD_CODE #472

Merged
merged 9 commits into from
Dec 24, 2021

Conversation

samsonasik
Copy link
Contributor

Q A
QA? ✔️

Apply Rector's SetList::DEAD_CODE Setlist to remove unnecessary code.

Mostly applied changes:

  • unnecessary docblock (param, return, when exactly same with no description)
  • unnecessary default value on property when always replaced in __construct.
  • remove default null on property as non-typed yet.
  • remove unnecessary cast as already typed.
  • remove parameter in last when never used in class method stmts
  • remove unnecessary assign.

Complete lists are at https://github.com/rectorphp/rector-src/blob/6a8d8233b963f3361383ce7a76a343be16837bff/config/set/dead-code.php

@butschster butschster added this to the 2.9 milestone Nov 11, 2021
@samsonasik
Copy link
Contributor Author

I will look into the errors, possibly skip rector rules that cause it.

rector.php Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 11, 2021

Codecov Report

Merging #472 (6818a95) into 2.8 (cc6cb37) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.8     #472      +/-   ##
============================================
+ Coverage     84.25%   84.28%   +0.02%     
+ Complexity     8754     8752       -2     
============================================
  Files          1192     1192              
  Lines         29793    29783      -10     
============================================
  Hits          25102    25102              
+ Misses         4691     4681      -10     
Impacted Files Coverage Δ
...outes/src/Bootloader/AnnotatedRoutesBootloader.php 92.85% <ø> (ø)
src/AnnotatedRoutes/src/Command/ResetCommand.php 100.00% <ø> (ø)
src/AnnotatedRoutes/src/GroupRegistry.php 100.00% <ø> (ø)
src/AnnotatedRoutes/src/RouteGroup.php 88.09% <ø> (ø)
src/AnnotatedRoutes/src/RouteLocator.php 100.00% <ø> (ø)
src/Annotations/src/AnnotatedClass.php 100.00% <ø> (ø)
src/Annotations/src/AnnotatedMethod.php 100.00% <ø> (ø)
src/Annotations/src/AnnotatedProperty.php 100.00% <ø> (ø)
src/Annotations/src/AnnotationLocator.php 80.00% <ø> (ø)
src/Attributes/src/Bridge/DoctrineReaderBridge.php 0.00% <ø> (ø)
... and 437 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc6cb37...6818a95. Read the comment docs.

@samsonasik
Copy link
Contributor Author

@butschster all green 🎉

rector.php Show resolved Hide resolved
@butschster butschster self-requested a review November 11, 2021 18:25
* form of a bitmask indicating the places where attributes
* can be defined.
*/
public function __construct(
Copy link
Member

Choose a reason for hiding this comment

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

@roxblnfk what do you think. Is this piece of code required?

Copy link
Member

Choose a reason for hiding this comment

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

Now this code is dead. Mb is it mistake?

src/Csrf/src/Middleware/CsrfFirewall.php Show resolved Hide resolved
src/Dumper/src/System.php Show resolved Hide resolved
@butschster butschster modified the milestones: 2.9, 2.8 Nov 12, 2021
@butschster butschster self-requested a review November 18, 2021 14:26
@butschster
Copy link
Member

@samsonasik hi! Sorry for long response. We didn't forget about your your PR, this week I'll try to check it and merge! Thank you!

@butschster butschster changed the base branch from 2.8 to 2.9 December 24, 2021 12:12
@butschster butschster modified the milestones: 2.8.x, 2.9 Dec 24, 2021
@butschster butschster merged commit cc48467 into spiral:2.9 Dec 24, 2021
@samsonasik samsonasik deleted the apply-dead-code-setlist branch December 24, 2021 15:32
@butschster butschster mentioned this pull request Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants