135 Commits

Author SHA1 Message Date
Tomas Votruba
d131d804d9
Bump min PHP version to 7.3 (#4838)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-09 23:25:53 +01:00
Abdul Malik Ikhsan
143164504e
[CodeQuality] Add UnwrapSprintfOneArgumentRector (#4827)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-09 12:29:01 +01:00
Tomas Votruba
bfd1953f97
move string downgrade types to object classes (#4801)
* move string downgrade types to object classes

* fix nullable type unwrap

* remove uneeded open tags from samples

* remove uneeded union type check
2020-12-06 00:27:00 +00:00
Tomas Votruba
8bfb36d0b2
[Downgrade] [PHP 7.3] Downgrade trailing commas in function calls (#4796)
Co-authored-by: Tommy Quissens <tommy.quissens@storefront.be>
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-05 22:40:10 +01:00
Krystian Marcisz
c85ee2df8d
[DX] Use MethodName const instead of string for __set_state (#4797) 2020-12-05 22:39:06 +01:00
TomasVotruba
25908c27f8 fix cs 2020-12-05 22:19:10 +01:00
Krystian Marcisz
47a9a52ffd
[CodeQuality] Add DateTimeToDateTimeInterfaceRector (#4791)
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-12-05 21:21:22 +01:00
Tomas Votruba
1f56646989
PHPStan rule decouple to Symplify (#4786)
* use ForbiddenMethodCallOnTypeRule from symplify

* fixup! use ForbiddenMethodCallOnTypeRule from symplify

* merge CommentCombiner to CommentsMerger
2020-12-05 11:41:55 +00:00
github-actions[bot]
c7d2af6966
[automated] Apply Coding Standard (#4784)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2020-12-05 11:07:25 +01:00
Tomas Votruba
5201e949a1
[PHPStanExtensions] Add ForbiddenMethodCallOnTypeRule + move from docComment and Comments to PhpDocInfo (#4780)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-05 00:22:12 +01:00
Tomas Votruba
09f17a7b64
[Downgrade] [PHP 8.0] Add DowngradePropertyPromotionToConstructorPropertyAssignRector (#4762)
* [Downgrade] [PHP 8.0] Add DowngradePropertyPromotionToConstructorPropertyAssignRector

* fix parent

* various fixes for PHP 8.0 tests

* [ci-review] Rector Rectify

* Update rules/downgrade-php80/tests/Rector/Class_/DowngradePropertyPromotionToConstructorPropertyAssignRector/DowngradePropertyPromotionToConstructorPropertyAssignRectorTest.php

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-03 13:27:24 +00:00
Krystian Marcisz
2eba542760
Fix UnusedForeachValueToArrayKeysRector on objects (#4750) 2020-12-02 14:09:35 +01:00
Markus Staab
74a17fde01
ArrayThisCallToThisMethodCallRector: use betterNodeFinder->findFirstParentInstanceOf() (#4707) 2020-11-27 11:43:53 +00:00
Abdul Malik Ikhsan
a38debb672
[DX] Fixes #4205 Change phpversion from string to php constant int type (#4679)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-24 16:32:49 +01:00
Tomas Votruba
014985e943
[CodingStyle] Add static support to PreferThisOrSelfMethodCallRector (#4660)
* [CodingStyle] Add static support to PreferThisOrSelfMethodCallRector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-19 12:37:50 +00:00
github-actions[bot]
a791be06c0
[automated] Apply Coding Standard (#4657)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2020-11-19 02:09:31 +01:00
Tomas Votruba
a7705ed0a5
[Symplify 9] First update + switch to RuleDocGenerator (#4616)
* [composer] bump to Symplify 9

* [Symplify 9] Update phpstan rules

* bump to Symplify 9 BETA2

* update AbstractKernel from Tests to Testing namespace

* decoupling removing node trait

* remove fluent calls

* removing variadic

* [CodingStyle] Improve AnnotateThrowablesRector

* bump deps

* Make use of RuleDocGenerator

* first short

* [DocumentationGenerator] Drop deprecated package, RuleSetGenerator now handles it

* import namespace

* update docs
2020-11-16 17:50:38 +00:00
Abdul Malik Ikhsan
7fcbac3230
[CodeQuality] ForToForeachRector improvement on ArrayDimFetch handling (#4613)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-15 17:12:48 +01:00
Abdul Malik Ikhsan
978087e846
[CodeQuality] Skip ForToForeachRector on assign count is used inside for statements (#4607)
* Failing fixture for to foreach assign count is used inside for

* Fix skip assign count used inside for statements

* cs fix

* use areNodesEqual()

* phpstan

* method naming

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-14 14:07:38 +00:00
Abdul Malik Ikhsan
75714bb3d6
[CodeQuality] Fixes #4578 Skip ForToForeachRector on complex init (#4579) 2020-11-11 17:08:28 +00:00
Abdul Malik Ikhsan
d876f5bf59
[CodeQuality] Fixes #4516 Skip Apply ArrayThisCallToThisMethodCallRector on array inside property (#4533) 2020-11-01 14:32:48 +01:00
Abdul Malik Ikhsan
55a0400a62
Typo Fix funciton -> function (#4532) 2020-11-01 09:51:52 +01:00
Tomas Votruba
0513315056
Change file system approach of MultipleClassFileToPsr4ClassesRector to file without namespace node (#4522)
* Change file system approach of MultipleClassFileToPsr4ClassesRector to file without namespace node

* update DecoupleClassMethodToOwnClassRector

* [ci] add rebase jobp

* disable fail fast for unit tests

* misc
2020-10-31 12:59:40 +00:00
Abdul Malik Ikhsan
a2ae659e0a
[CodeQualityStrict] Enable MoveOutMethodCallInsideIfConditionRector (#4502)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-29 21:47:12 +01:00
Abdul Malik Ikhsan
9e0b632e4e
[CodeQualityStrict] Add CountArrayToEmptyArrayComparisonRector to CodeQualityStrict (#4496)
Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-10-29 09:59:39 +01:00
Tomas Votruba
35502016a6
Improve MoveOutMethodCallInsideIfConditionRector (#4492)
* skip rename

* add method call and variable name for MoveOutMethodCallInsideIfConditionRector

* decouple MethodCallToVariableNameResolver

* use trick with Scope if variable is already defined

* fixup! use trick with Scope if variable is already defined

* cover case with variable name and method call

* add decopule note future

* [ci-review] Rector Rectify

* [ci] try re-trigger ci-review after push automatically

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-27 15:51:44 +00:00
Abdul Malik Ikhsan
7a1ea1328b
[CodeQuality] Register MoveOutMethodCallInsideIfConditionRector to config code-quality set (#4477)
* [CodeQuality] Register MoveOutMethodCallInsideIfConditionRector to config code-quality set

* rename use string parameter

* phpstan

* fix false positive string param to be var === variable name

* fix false positive

* phpstan

* ensure not same variable

* phpstan

* add ucfirst after var

* add fixture failing test for variable exists to be skipped

* add fixture failing test for variable exists in previuos statement

* phpstan space

* add handling variable exists in previous statement and in ClassMethod/Functions args

* handle exists but inside if

* reduce complexity

* clean up

* clean up

* cs fix

* phpstan

* remove - in variable

* use fallback when first character is numeric

* using regex to check string start alpha for variable

* cs fix

* use ClassConstFetch name to set variable name

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* clean up

* fix

* [ci-review] Rector Rectify

* Update rules/code-quality/src/Rector/If_/MoveOutMethodCallInsideIfConditionRector.php

* Update rules/code-quality/src/Rector/If_/MoveOutMethodCallInsideIfConditionRector.php

Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-10-26 14:03:26 +00:00
Tomas Votruba
0f2e6d407e
[DoctrineAnnotaitonGenerated] Update to doctrine/annotations 1.11 + fix static (#4479) 2020-10-25 14:43:05 +01:00
Abdul Malik Ikhsan
11c76808be
[CodeQuality] Add MoveOutMethodCallInsideIfConditionRector (#4457)
* Add MoveOutMethodCallInsideIfConditionRector

* cs fix

* implemented handling pass constant to arg 0

* phpstan

* final touch: no need strtolower() before ucfirst on fallback var name
2020-10-23 15:15:54 +02:00
Tomas Votruba
10ae0d687a
[CodeQuality] Add NewStaticToNewSelfRector (#4468)
* [CodeQuality] Add NewStaticToNewSelfRector

* regenerated docs

* drop patches
2020-10-20 22:01:47 +00:00
Tomas Votruba
aa98eb5d9e
[CodeQuality] Skip dynamic properties for bindTo() (#4467)
* [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

* [rector] [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

* [cs] [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-20 22:43:05 +02:00
Tomas Votruba
75d25a1dcb
[CodeQuality] Decouple complete dynamic properties rector, add skip of Closure::bind() (#4466)
* [ci] temporarily hide split monorepo

* [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

* [rector] [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

* [cs] [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-20 20:27:12 +00:00
Tomas Votruba
5988584736
[CodeQuality] Improve missing property type resolution for array dim fetch (#4462)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-20 20:35:35 +02:00
Tomas Votruba
b9f45eab00
[CodeQuality] Skip nested foreach (#4461) 2020-10-20 17:07:01 +02:00
Tomas Votruba
8bdb879a55
[CodeQuality] Add nested foreach foreach that is required for assign (#4459) 2020-10-20 14:24:32 +00:00
Tomas Votruba
9d2757f80d
[CodeQuality] Support multi boolean and in isset on property (#4455)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-20 12:50:21 +02:00
Abdul Malik Ikhsan
26ab509d7a
[CodeQuality] Register IssetOnPropertyObjectToPropertyExistsRector to code-quality config set (#4441)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-18 20:42:49 +02:00
Tomas Votruba
fd9bd00713
[DoctrineCodeQuality] Fix oveCurrentDateTimeDefaultInEntityToConstructorRector for default value (#4436)
* [DoctrineCodeQuality] Fix oveCurrentDateTimeDefaultInEntityToConstructorRector for default value

* re-use local property method

* improve new_ nesting

* [rector] improve new_ nesting

* static fixes

* bump deps

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-18 08:45:56 +00:00
Tomas Votruba
1c8fac5242
Add meta node FileWithoutNamespace (#4355)
* [CakePHP] Promote AppUsesStaticCallToUseStatementRector to File

* [CakePHP] Change ImplicitShortClassNameUseStatementRector to FileWithoutNamespace approach

* [Renaming] Update PseudoNamespaceToNamespaceRector to use FileWithnoutNamespace

* [rector] [Renaming] Update PseudoNamespaceToNamespaceRector to use FileWithnoutNamespace

* [cs] [Renaming] Update PseudoNamespaceToNamespaceRector to use FileWithnoutNamespace

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-05 08:39:02 +00:00
Abdul Malik Ikhsan
8e58d44acf
[Code Quality] Fixes #4286 Skip ArrayKeyExistsTernaryThenValueToCoalescingRector when else is a not null (#4298) 2020-09-27 22:34:02 +02:00
Tomas Votruba
d7f90774ee
allow php-parser 4.10 + fixes of args merge change (#4277)
* allow php-parser 4.10 + fixes of args merge change

* use fixed php-parser 4.10.1
2020-09-23 20:22:35 +00:00
Abdul Malik Ikhsan
8ef90fd61a
Fixes #3939 Add IssetOnPropertyObjectToPropertyExists rule (#4214) 2020-09-15 13:29:25 +02:00
Igor
f2ecdeb0b1
[Naming] Foreach over "data", renames to "datum" (#4221)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-15 10:23:13 +02:00
Tomas Votruba
59c5a5e5ba
[NodeRepository] Merge function like finder to NodeRepository (#4186)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-11 00:09:05 +02:00
Tomas Votruba
f5f7ba76af
[NoreRepository] merge ClassLikeParsedNodesFinder to NodeRepository (#4185)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-10 14:56:54 +02:00
Abdul Malik Ikhsan
bcb9580353
apply run ecs check-heredoc-nowdoc command to packages and rules directory (#4138) 2020-09-08 15:27:17 +02:00
Tomas Votruba
1a2e9cbb33
static fixes (#4140) 2020-09-07 17:40:46 +02:00
Tomas Votruba
740ccda385
[CodingStyle] Drop SimplifyBoolIdenticalTrueRector, does not bring expected value (#4113) 2020-09-02 20:12:58 +00:00
Tomas Votruba
7ac228c638
[CI] Add type-declaration set (#4089)
* [CI] Add type-declaration set

* [rector] [CI] Add type-declaration set

* [cs] [CI] Add type-declaration set

* skip nullable void

* add anonymous parent/interface support

* refactor MultiExceptionCatchRector to use Catch_ over integers

* type fixes

* fix unoin array type override

* remove unused test cases

* drop overcomplicated InlineValidationRulesToArrayDefinitionRector

* skip assign on var

* [rector] skip assign on var

* [cs] skip assign on var

* [rector] [cs] skip assign on var

* skip assign on var

* fixes

* [rector] fixes

* [cs] fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-01 17:56:30 +00:00
Tomas Votruba
351e59fa3b
Fix array type (#4058)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-29 16:20:27 +02:00