1171 Commits

Author SHA1 Message Date
Tomas Votruba
bc41ba2b2e
phpstan cleanup (#4509)
* move tag objects to ValueObject namespace

* [ci] temporarily disable weird broken monorepo split, wait for move to github actoins
2020-10-29 23:06:26 +01:00
Tomas Votruba
91a354c080
[NetteCodeQuality] Fix ChangeFormArrayAccessToAnnotatedControlVariableRector for in-closure (#4506)
* [NetteCodeQuality] Fix ChangeFormArrayAccessToAnnotatedControlVariableRector for in-closure

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* fix name

* fix unknown mixed type on fluent

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-29 21:25:35 +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
449801e1f3
Add regex uri to regex constant (#4504)
Co-authored-by: Jan Lohage <j2L4e@users.noreply.github.com>
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-29 19:04:33 +01:00
Tomas Votruba
252f17821e
fix non-existing method trying to get method reflection (#4505) 2020-10-29 16:45:13 +00: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
2116630748
[ci] remove old merageable file (#4497)
* [ci] remove old merageable file

* updat ecs
2020-10-28 23:26:17 +00:00
Tomas Votruba
9314c4b173 fix cs 2020-10-28 23:03:13 +01:00
Abdul Malik Ikhsan
c54377da25
[Performance] Add CountArrayToEmptyArrayComparisonRector (#4489)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-28 22:59:21 +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
Tomas Votruba
a1e50263d2
[cs] improve configured rules types (#4491)
* [cs] improve configured rules types

* [ci] update env variable
2020-10-27 14:00:39 +00:00
Tomas Votruba
44b27f779e
[EarlyReturn] Decouple new set (#4490)
* [set] decouple new code-quality-strict

* decopule early-return set [closes #4464]

* [docker] drop prestissimo, as composer v2 does not need it

* [ci] move coding standard to ci_review

* [ci] try to run rector-ci on contributors
2020-10-27 13:47:37 +00:00
Tomas Votruba
a6e85fe69a
[PHPUnit] Fix AddSeeTestAnnotationRector for same short name, but different namespace (#4488)
* [PHPUnit] Fix AddSeeTestAnnotationRector for same short name, but different namespace

* correct namespaces
2020-10-27 00:42:04 +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
5f3b4bde1f
[Naming] Allow does in MakeIsserClassMethodNameStartWithIsRector (#4486) 2020-10-26 10:22:20 +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
Abdul Malik Ikhsan
be06b60eac
Typo Fix: Strings::endWith() should be Strings::endsWith() (#4475)
* Typo Fix: Strings::endWith() should be Strings::endsWith()

* [rector] Typo Fix: Strings::endWith() should be Strings::endsWith()

* [cs] Typo Fix: Strings::endWith() should be Strings::endsWith()

* phpstan

* [rector] phpstan

* [cs] phpstan

* cs fix

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-23 11:23:12 +02:00
Tomas Votruba
6c51f3fb4f
[Restoration] Add InferParamFromClassMethodReturnRector (#4471)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-21 23:06:24 +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
TomasVotruba
7c303021c4 [PHP 7.1] Skip variable arguments count for RemoveExtraParametersRector 2020-10-20 15:05:37 +02: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
Tomas Votruba
4f37d2ec3f
decouple ProjectType from Option (#4451) 2020-10-19 15:11:40 +00:00
Tomas Votruba
9869678e4a
[DeadCode] Fix removal of if->cond (#4450) 2020-10-19 16:38:02 +02:00
Tomas Votruba
5b37363b60
[DeadCode] Add expr-names support to RemoveEmptyMethodCallRector (#4448)
* [DeadCode] Add expr-names support to RemoveEmptyMethodCallRector

* skip abstract method
2020-10-19 13:35:37 +00:00
Tomas Votruba
c18b06b474
[DeadCode] Cover array dim fetch assign (#4446) 2020-10-19 01:46:38 +02:00
Tomas Votruba
29594b63f4
[DeadCode] Count arg value as used (#4445) 2020-10-18 23:18:04 +00:00
Raffael Comi
073a2a3eee
Infer var type annotation only if none exists (#4443) 2020-10-19 00:05:36 +02:00
Tomas Votruba
f96372e1c0
make use of Types of doc types (#4444) 2020-10-18 21:49:54 +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
e845d7cea8
[DoctrineCodeQuality] Add ImproveDoctrineCollectionDocTypeInEntityRector (#4442)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-18 18:29:35 +02:00
Raffael Comi
055040f8e8
Downgrade PHP7.4 array_merge without arguments (#4377) (#4440) 2020-10-18 16:37:02 +02:00
TomasVotruba
8e7c521c41 typo 2020-10-18 11:03:19 +02:00
TomasVotruba
009e73886c typo 2020-10-18 11:02:40 +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
Abdul Malik Ikhsan
67bdc35fe5
[core] Add ClassReflectionToAstResolver service (#4438) 2020-10-18 10:31:37 +02:00
Abdul Malik Ikhsan
c6eb33ab2f
[DeadCode] Improve RemoveEmptyMethodCallRector: Using PHPStan\Reflection\ClassReflection->isBuiltIn() to check internal class (#4435) 2020-10-17 18:40:40 +02:00
Abdul Malik Ikhsan
ba4ec9de09
[DeadCode] Fixes #4425 Remove empty method call (#4428)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-17 17:29:10 +02:00
Tomas Votruba
9f7073ada3
[NodeAnalyzer] Check property fetch for read (#4431)
* [NodeAnalyzer] Check property fetch for read

* [ReadWrite] Decopule new package for read/write/only analysis

* add property fetch
2020-10-16 20:16:36 +00:00
Tomas Votruba
245000a0ce
[DeadCode] Improve unused private property detection (#4430)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-16 21:29:29 +02:00
Leonardo Losoviz
8ba46c51e4
[Downgrade PHP7.3] Remove unneeded params from list(), and even remove list() (#4392)
* Remove unneeded params from `list` and even `list`

* Fixed cs

* Re-ordered private methods

* Fixed rector-ci

* Fixed cs

* Fixed phpstan error

* Use typehint, not docblock

* Fixed phpstan cognitive complexity error

* Fixed rector-ci

* Improved code sample

* Fixed code sample

* Extracted code into function

* Reduced complexity

* Reduced complexity

* Reduced  complexity

* Added comment

* Renamed function

* Documented code

* Moved code into function

* Fixed cs

* Fixed rector-ci
2020-10-16 00:44:29 +02:00
Leonardo Losoviz
139823a3a2
[Downgrade PHP 7.4] Support iterable pseudo-type when downgrading the array spread (#4404)
* Support iterable pseudo-type

* Renamed function

* Fixed cs
2020-10-16 00:25:34 +02:00
Tomas Votruba
16031da4b7
[DeadCode] Fix binary different nesting in RemoveOverriddenValuesRector (#4422)
* decopule NodeByTypeAndPositionCollector

* decouple VariableUseFinder
2020-10-15 20:23:25 +00:00
Pol Dellaiera
09dc6cef9a
Issue #4413: Do not refactor iterator_to_array. (#4415)
* Issue #4413: Do not refactor iterator_to_array.

Signed-off-by: Pol Dellaiera <pol.dellaiera@protonmail.com>

* Issue #4413: Update tests based on review feedback.

* Issue #4413: Fix CS.
2020-10-15 17:55:38 +02:00
Tomas Votruba
b2c9e3b127
[DeadCode] Make RemoveUnusedPrivateConstantRector skip enum (#4419) 2020-10-15 13:04:58 +00:00