1431 Commits

Author SHA1 Message Date
Abdul Malik Ikhsan
cc20158cf1
[CodingStyle] Add %s for pass PHP_EOL constant on EncapsedStringsToSprintfRector (#5072)
* Add failing test fixture for EncapsedStringsToSprintfRector

# Failing Test for EncapsedStringsToSprintfRector

Based on https://getrector.org/demo/1b647b4f-dde9-4f90-b05e-74744045a3d1

* Fix for prefixed_eol.php.inc

* Check against PHP_EOL

* allowing newline to be prefixed as well

* [CodingStyle] Closes #5060 Fixes #5032 Add %s for pass PHP_EOL constant

* skip multiple eol

* use PHP_EOL const

* [ci-review] Rector Rectify

Co-authored-by: bruce aldridge <bruce@incode.co.nz>
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-02 22:59:58 +01:00
Abdul Malik Ikhsan
e6a4dfdd89
[CodingStyle] Skip dynamic args on UnSpreadOperatorRector (#5070)
* UnSpreadOperatorRector: Should be kept on dynamic method calls

# Failing Test for UnSpreadOperatorRector

Based on https://getrector.org/demo/72c7df1d-01a2-4f1b-923f-2c5dedd7b636

* Closes #5069 Skip dynamic args on UnSpreadOperatorRector

* fixture update

* reduce complexity

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-02 21:28:19 +01:00
Abdul Malik Ikhsan
ec986c1090
[CodeQuality] Do not namespacing "static" on GetClassToInstanceOfRector (#5071)
* Add failing test fixture for GetClassToInstanceOfRector

# Failing Test for GetClassToInstanceOfRector

Based on https://getrector.org/demo/c605ea4b-824c-4fb6-8357-2b71a87098b6

* [CodeQuality] Closes #5064 Do not namespacing "static" on GetClassToInstanceOfRector

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-02 21:27:01 +01:00
Abdul Malik Ikhsan
f5fbeab2b7
[Type Declaration] Skip AddArrayReturnDocTypeRector on return php doc (#5067)
* Add failing test fixture for AddArrayReturnDocTypeRector

Return php doc should not be overriden when is more specific then one inferred by rector. 

# Failing Test for AddArrayReturnDocTypeRector

Based on https://getrector.org/demo/5dc16502-4bb7-4f34-9922-35f56111ae9c

* Create return_php_doc_should_not_be_replaced_by_less_specific_type_2.php.inc

* Update and rename return_php_doc_should_not_be_replaced_by_less_specific_type.php.inc to skip_return_php_doc1.php.inc

* Update and rename return_php_doc_should_not_be_replaced_by_less_specific_type_2.php.inc to skip_return_php_doc2.php.inc

* [Type Declaration] Closes #5028 Skip AddArrayReturnDocTypeRector on return php doc

* add nested case fixture

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-02 17:48:25 +01:00
Abdul Malik Ikhsan
6d6abf0bf2
[PHP 7.3] Skip RegexDashEscapeRector double escape (#5066)
* Add failing test fixture for RegexDashEscapeRector

# Failing Test for RegexDashEscapeRector

Based on https://getrector.org/demo/d351fdc0-409a-4f7e-aeb0-a5ee70da2a8b

* [PHP 7.3] Fixes #5055 Closes #5056 Skip RegexDashEscapeRector on escaped

Co-authored-by: Simon Brüchner <powtac@gmx.de>
2021-01-01 23:26:38 +01:00
Tomas Votruba
86aedf2527
[NetteToSymfony] Add new Route class support (#5065) 2021-01-01 20:46:17 +01:00
github-actions[bot]
54e0210d68
[automated] Apply Coding Standard (#5062)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-01 19:54:49 +01:00
Abdul Malik Ikhsan
1c26598518
[CodingStyle] Register UnSpreadOperatorRector to coding-style config set (#5050) 2020-12-31 14:28:58 +01:00
Grzegorz Korba
7a82928e08
Skip variadic arguments from property promotion (#5046) 2020-12-30 20:31:55 +01:00
Tomas Votruba
6ddb4effd8
[PHPStanStaticTypeMapper] Add closure conversion (#5043) 2020-12-29 21:22:48 +00:00
Tomas Votruba
1850a2dcc2
[Renaming] Add test fixture for same-namespaced short class fail (#5040)
Co-authored-by: Tom Klingenberg <tklingenberg@lastflood.net>
2020-12-29 17:01:51 +00:00
Tomas Votruba
59b71e04a3
respect PHPStan descission to drop & in param docs (#5035)
* revert phpdoc support for reference in params

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-29 11:12:32 +00:00
Tomas Votruba
c7140076ec
use clone const (#5029) 2020-12-28 23:38:05 +00:00
Tomas Votruba
8ed61a7560
Add support for inheritdoc in parent type use (#5020)
Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2020-12-28 17:57:21 +01:00
Tomas Votruba
0f221f92a4
Add template annotation resolving support (#5019)
Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2020-12-28 13:01:27 +00:00
Tomas Votruba
96ad185d37
[TypeDeclaration] Skip array shrapnels (#5016)
* [TypeDeclaration] Skip array shrapnels

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-28 11:49:30 +00:00
Jan Kuchař
305388d45d
Add failing test fixture for AddArrayReturnDocTypeRector - array shape is replaced by structural type (#5013)
# Failing Test for AddArrayReturnDocTypeRector

Based on https://getrector.org/demo/4afc86f8-de78-4f13-bed4-3644f1b16d6d
2020-12-28 12:38:34 +01:00
Leonardo Losoviz
44e817fa0b
Access classes installed on DEV through their strings (#4897)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-28 12:20:51 +01:00
Abdul Malik Ikhsan
bd1bd30762
[CodingStyle] Add UnSpreadOperatorRector (#5015)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-28 12:08:40 +01:00
Abdul Malik Ikhsan
d8e13e9144
[AbstractRector] Add rollbackComments (#5005) 2020-12-27 10:54:05 +01:00
Tomas Votruba
8de8cddaf6
[PHP 8.0] Skip accessed variable before property assign (#5008)
Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2020-12-27 02:07:52 +00:00
TomasVotruba
f49c14618a clean 2020-12-27 02:45:00 +01:00
Tomas Votruba
28a02fbfcd
Add failing test fixture for RemoveCodeAfterReturnRector
# Failing Test for RemoveCodeAfterReturnRector

Based on https://getrector.org/demo/efb7f3ed-e28a-4f31-b83f-50adfb17d309
2020-12-27 02:39:11 +01:00
Tomas Votruba
8c516e4f5c
[PHP 8.0] Skip promotion property if worked with before assign (#5006)
* test: ClassPropertyAssignToConstructorPromotionRector: should ignore early returns

* correct file location

* [PHP 8.0] Skip usage of variable before assign in promotion property

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2020-12-27 01:04:31 +00:00
TomasVotruba
5e358ec38a fix property varlike vs var name 2020-12-27 00:41:30 +01:00
Tomas Votruba
ec92bcc95e
[phpstan] enable file lenght rule (#4999)
* enable file lenght rule

* longer file, just to show ci worked

* [ci] add ValidateFileLengthCommand

* [phpstan] drop PathsAreNotTooLongRule

* [Downgrade] Shorten property promotion rector rule

* [Symfony] Shorten AutoWireWithClassNameSuffixForMethodWithRequiredAnnotationRector name

* shorten fixture name

* rename ChangeControlArrayAccessToAnnotatedControlVariableRector to AnnotateMagicalControlArrayAccessRector

* rename ReplaceMagicEventPropertySubscriberWithEventClassSubscriberRector to ReplaceMagicPropertyWithEventClassRector

* rename GetConfigWithDefaultsArgumentToArrayMergeInCompilerExtensionRector to MergeDefaultsInGetConfigCompilerExtensionRector

* rename ChangeCollectionTypeOptionTypeFromStringToClassReferenceRector to ChangeStringCollectionOptionToConstantRector

* decouple ProjectFilesFinder
2020-12-26 14:53:21 +00:00
Tomas Votruba
32272a97a1
[PHPStan] Added PathsAreNotTooLongRule phpstan rule (#4998)
* Added PathsAreNotTooLongRule phpstan rule

* static fixes

Co-authored-by: Markus Staab <m.staab@complex-it.de>
2020-12-26 13:35:23 +00:00
Abdul Malik Ikhsan
3ef72c375f
[DeadDocBlock] Skip RemoveNonExistingVarAnnotationRector on has other comment before var (#4988)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-26 11:30:52 +01:00
Tomas Votruba
4e06c46253
[cs] add variable types (#4996) 2020-12-25 22:10:35 +00:00
Tomas Votruba
ed475a2e3c
[static] no nullable node (#4995)
* move phpstan.neon cusotm rules to rector-rules.neon, to cleanup main config

* enable forbidden rule on nullable nodes

* bump to Symplify 9.0.17

* make name non-nullable

* skip non-nullable

* skip null dim
2020-12-25 20:50:50 +00:00
Tomas Votruba
51dd6b899a
[SOLID] Drop UseInterfaceOverImplementationInConstructorRector, very subjective (#4993) 2020-12-25 17:24:53 +00:00
Tomas Votruba
a4f8a23ecf
[CodeQuality] Move MoveVariableDeclarationNearReferenceRector (#4992) 2020-12-25 17:48:15 +01:00
Tomas Votruba
db89b5eefa
[CodeQuality] Move MoveVariableDeclarationNearReferenceRector (#4989)
* [CodeQuality] Move MoveVariableDeclarationNearReferenceRector

* move code-quality-strict rules to own namespace

* move MoveVariableDeclarationNearReferenceRector to CodeQualityStrict

* add ClassConstFetchFactory

* static fixes
2020-12-25 16:22:19 +00:00
Tomas Votruba
a2dbaedb0e
[Privatization] Move MakeUnusedClassesWithChildrenAbstractRector here (#4987) 2020-12-25 15:45:17 +01:00
Tomas Votruba
bfcdd22a7c
[Privatization] Move FinalizeClassesWithoutChildrenRector here (#4986) 2020-12-25 14:59:14 +01:00
Tomas Votruba
cffd7ea0ac
[CodingStyle] Move PHPStormVarAnnotationRector (#4985)
* [CodingStyle] Move PHPStormVarAnnotationRector

* [ci-review] Rector Rectify

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here (#4984)

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>

* [ci-review] Rector Rectify

* cleanup docs

* static fixes

* [ci-review] Rector Rectify

* remove duplicated

* multi use case

* misc

* [ci-review] Rector Rectify

* fixes

* remove order set, slow

* move UseMessageVariableForSprintfInSymfonyStyleRector from solid set to coding-style

* make unique-named variables to prevent accidental override and improve readability

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 13:20:13 +00:00
Abdul Malik Ikhsan
ec5daad132
[Util] Add StaticInstanceOf (#4979)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 12:53:26 +01:00
Tomas Votruba
61b72a8d7c
[DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here (#4984)
* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 00:56:59 +00:00
Tomas Votruba
d465ec83e2
[DeadCode] Move RecastingRemovalRector from PHPStan set (#4983)
* [DeadCode] Move RecastingRemovalRector from PHPStan set

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 00:22:45 +00:00
TomasVotruba
0326aec71c renames on regex 2020-12-25 00:28:36 +01:00
Tomas Votruba
5a47e36b72
Add Visibility consts (#4981) 2020-12-24 23:01:30 +01:00
Tomas Votruba
d03fb14c3f
fix parent visilibty (#4980) 2020-12-24 21:58:07 +01:00
Tomas Votruba
319d6bfca1
add phpstan-for-rector config path, consolidate return type extensions - re-use from Symplify (#4973)
* add phpstan-for-rector config path, to separate phpstan and extensions that help Rector with precise types

* move type value object to value object

* moving

* remove KernelGetContainerAfterBootReturnTypeExtension, use one from symplify

* remove ContainerGetDynamicMethodReturnTypeExtension to ContainerGetReturnTypeExtension

* remove nette extension

* add nette-extension

* removed delegated rule

* delegate implmenets + code sample PHPStan rule to symplify
2020-12-24 16:31:24 +00:00
Abdul Malik Ikhsan
ca0b4cfdc7
[EarlyReturn] Register ChangeOrIfReturnToEarlyReturnRector to early-return set (#4975)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-24 17:28:56 +01:00
Abdul Malik Ikhsan
9433616c63
[EarlyReturn] Add ChangeOrIfReturnToEarlyReturnRector (#4974)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-24 14:20:16 +01:00
Abdul Malik Ikhsan
cb5a36434e
[PHP 7.4] Skip TypedPropertyRector on standalone null type (#4972)
Fixes #4956
2020-12-24 11:02:32 +01:00
Tomas Votruba
f6900e687c
[PHP 8.0] Skip exception in match, must be expr (#4971)
* [PHP 8.0] Skip exception in match, must be expr

* add test case for var strings

* [ci-review] Rector Rectify

* skip universal

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-23 23:44:16 +00:00
Tomas Votruba
61e1ceaf5c
Cover ArrayShape type and other doc nodes (#4967)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-23 22:11:37 +01:00
Abdul Malik Ikhsan
8a648216ca
[CodingStyle] Re-use assigned variable for Method/Static/FuncCall/New_ on SplitDoubleAssignRector (#4968) 2020-12-23 21:42:40 +01:00
Tomas Votruba
aa35633c66
use getService() API call over static (#4970) 2020-12-23 21:40:46 +01:00