575 Commits

Author SHA1 Message Date
Tomas Votruba
499d452f99
Various improvements (#4717) 2020-11-27 21:39:42 +01:00
Tomas Votruba
377c734975
drop old compiler (#4716) 2020-11-27 17:54:14 +01:00
Tomas Votruba
0eb6e29176
drop MinimalVersionChecker, is checked by composer itself (#4715)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-27 17:32:38 +01:00
Tomas Votruba
8e7c4bfc96 [CI] do not push to forks 2020-11-24 21:30:17 +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
da6d703687
Improve Blade class renames (#4676)
* [Console] Use single point of command naming

* use blade in process command

* filter out blade templates from PHP files

* make test process blade as non php file

* add failing test

* remove duplicated tests

* rename php to php.inc suffix to make it skip to CI tools

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-23 19:16:48 +00:00
Tomas Votruba
cb57430655
[Renaming] Add renaming support for blade.php templates in Laravel (#4672)
* [CI] fix monorepo split

* naming, add blade.php suffix

* [Renaming] Add class rename support for laravel blade templates

* skip test fixture
2020-11-23 11:35:42 +00:00
Abdul Malik Ikhsan
715b616ada
[Solid] use Variable node type for for MoveVariableDeclarationNearReferenceRector (#4670)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-23 11:40:29 +01:00
Tomas Votruba
b770151159 fix static 2020-11-20 11:46:12 +00:00
Tomas Votruba
26b71cce1d
[Laravel] Improve static to DI set (#4662) 2020-11-20 01:26:04 +01:00
Tomas Votruba
a6bec3d07e
remove RequireClassTypeInClassMethodByTypeRule (#4634) 2020-11-17 12:22:53 +01:00
Tomas Votruba
661b2f0a65
[Symplify 9] Follow up + phpstan rules tidying (#4625)
* improve static

* improve phpstan rules

* [PHPStanExtensions] Drop CheckCodeSampleBeforeAfterAlwaysDifferentRule, already part of domain in CodeSample

* cleanup
2020-11-16 23:32:24 +00: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
Tomas Votruba
2a2c49d4ae
[PHPUnit] Add ConstructClassMethodToSetUpTestCaseRector (#4603)
* [CI] enable automated changelog regenerate

* [CI] drop generate docs, already part of PRs

* [PHPUnit] Add ConstructClassMethodToSetUpTestCaseRector

* make use of SetUpClassMethodFactory
2020-11-13 20:32:18 +00:00
Tomas Votruba
7e3f8bdafc
[Laravel] Add AddMockConsoleOutputFalseToConsoleTestsRector (#4589)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-12 21:47:25 +01:00
Abdul Malik Ikhsan
11fbc4c1c9
[BetterStandardPrinter] Fixes #4274 #4573 Annotation callback and Route values should not be changed (#4576)
* [BetterStandardPrinter] Fixes #4274 Annotation callback value should not changed to const

* backtrack fix

* update regex link

* namespace fix

* [ci-review] Apply coding standards

* [ci-review] Rector Rectify

* php 7.2 syntax

* Fixes #4573

* regex fix

* rework, need to one by one step

* handle route annotation

* phpstan

* [ci-review] Apply coding standards

* move content patch functionalities to new service : ContentPatcher

* [ci-review] Rector Rectify

* clean up phpstan

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-11 13:06:46 +00:00
Abdul Malik Ikhsan
b4fd52021d
[PHP 8.0] Improve NullsafeOperatorRector : Skip no direct usage after if in next statement at last (#4565)
* [PHP 8.0] Improve NullsafeOperatorRector : Skip no direct usage after if

* [ci-review] Apply coding standards

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-09 13:14:57 +00:00
Tomas Votruba
44063910e6 remove unused config 2020-11-08 22:37:03 +00:00
Tomas Votruba
abb3c18570 remove unused config 2020-11-08 22:36:39 +00:00
Abdul Malik Ikhsan
600334eafa
Fixes #4499 Code duplication on interface_exists and trait_exists inside if condition (#4553)
* debug content forat interface_exists

* add link to the post about format preserving

* Fixes #4499 Closes #4548

* [ci-review] Rector Rectify

* allow 0 space

* ensure matches[0] = matches[1] . matches[1]

* ensure count matches is 2

* phpstan

* [ci-review] Rector Rectify

* add test

* phpstan

* handle no {}

* clean up

* [ci-review] Rector Rectify

* fixture fix

* phpstan

* add @see https://github.com/rectorphp/rector/issues/4499 reference issue

Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-04 22:32:49 +01:00
Tomas Votruba
e7c1ded364
fix linter (#4537) 2020-11-01 16:57:12 +01:00
Tomas Votruba
8542a3bcbc
Move from Filesystem rules to FileNode (#4528)
* make MoveServicesBySuffixToDirectoryRector with non-filesystem rector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Apply coding standards

* fixup! make MoveServicesBySuffixToDirectoryRector with non-filesystem rector

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-31 21:39:09 +00:00
Tomas Votruba
5147844615
change RenameSpecFileToTestFileRector filesystem to normal one (#4525) 2020-10-31 16:20:30 +00:00
Tomas Votruba
562c96a6c2 drop coding machines strict rules, unused 2020-10-31 14:15:22 +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
Tomas Votruba
b302e493dd
[SOLID] Add MoveVariableDeclarationNearReferenceRector (#4410)
* Create test cases

* Create rector

* Add closure to possible parent scopes

* Register in SOLID set

* Document the feature

* fix adding variable in closure

* move MoveVariableDeclarationNearReferenceRector to Assign category, based on getNodeTypes()

* ci: drop phpunit matcher, not much helpful

* ignore for now, many cases to cover

* prepare release

Co-authored-by: Anna Filina <afilina@gmail.com>
2020-10-30 13:25:24 +00:00
Tomas Votruba
dc2047f70a
[TypeDeclaration] Switch from stringy types to PHPStan types (#4510)
* nette-30 config cleanup

* [TypeDeclaratoin] Move AddReturnTypeDeclarationRector from generic

* add Type support to AddReturnTypeDeclaration

* make AddParamTypeDeclarationRector use PHPStan type objects over strings

* [SymfonyPhpConfig] Add support for nested types

* drop StringTypeToPhpParserNodeMapper

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-30 11:58:35 +00:00
Tomas Votruba
63037fe924
[DynamicTypeAnalysis] Drop for too theoretical content, needs real project to test out (#4511) 2020-10-30 00:30:10 +00:00
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
5d190a3d55
phpstan cleanup config (#4507) 2020-10-29 21:34:51 +00: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
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
80d688413d fix stan 2020-10-26 11:44:06 +01:00
Tomas Votruba
bdf9464d25 skip bugged phpstan file 2020-10-25 14:56:11 +01: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
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
8bdb879a55
[CodeQuality] Add nested foreach foreach that is required for assign (#4459) 2020-10-20 14:24:32 +00: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
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
Tomas Votruba
e085f52f86
[DeadCode] Improve parent and current type comparison on RemoveDelegatingParentCallRector (#4409)
* decouple CurrentAndParentClassMethodComparator

* fix param reflections

* [rector] fix param reflections

* [cs] fix param reflections

* composer: bump assert

* [rector] composer: bump assert

* [cs] composer: bump assert

* static fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-14 17:14:55 +00:00
Abdul Malik Ikhsan
eb1f9c5e32
reactivate coverage report (#4405) 2020-10-14 18:07:59 +02:00
Tomas Votruba
8af70b5ac0
[Defluent] Refactoring to multiple rules (#4400)
* [Defluent] Refactoring to multiple rules

* [Defluent] Decouple defluent-only set, it deserved to have own domain

* cleanup

* [rector] cleanup

* [cs] cleanup

* fixup! cleanup

* static fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-14 04:24:29 +00:00
Tomas Votruba
01514ab9a8
[SimplePhpDocParser] Add README + getParam*() helper methods (#4393) 2020-10-11 16:17:43 +02:00
TomasVotruba
40db4ee347 static fixes 2020-10-11 00:55:28 +02:00
Tomas Votruba
5cb49a2d5a
[PSR-4] Move from FileSystemRector to FileWithoutNamespace node (#4372) 2020-10-08 23:28:24 +02:00
Tomas Votruba
8134a847fe
cs fixes (#4369) 2020-10-07 16:20:53 +02: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
Tomas Votruba
7e124dffc0
[static] replace string attirbutes with contants + fix require rule (#4354)
* replace string attirbutes with contants

* static fixes

* composer: bump sypmlify

* composer: drop branch alias, not usedp
2020-10-04 22:19:25 +00:00