242 Commits

Author SHA1 Message Date
Abdul Malik Ikhsan
de09409152
[mysql-to-mysqli] Handle second parameter on mysqli_query swap for sql - conn variable (#5130)
Co-authored-by: Martin <admin@phpcode.eu>
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-11 12:12:46 +01:00
Tomas Votruba
d1df8f76cd
drop PHPStanAttributeTypeSyncer, handled by external package (#5131) 2021-01-10 14:51:27 +01:00
Tomas Votruba
074298d35c
static fixes (#5127)
* static fixes

* fix remove class rule for tests
2021-01-10 11:01:40 +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
Michal Lulco
fee81507bb
Do not prefix Symplify\SymfonyPhpConfig (#5030) 2020-12-29 01:17:46 +01:00
TomasVotruba
3f07620ef1 unprefix Symplify/RuleDocGeneator 2020-12-28 23:11:17 +01:00
Tomas Votruba
52e604c6dd
[scoper] unprefix string classes to match types (#5025) 2020-12-28 23:09:11 +01:00
Tomas Votruba
520335251d
[scoper] keep phpstan.phar to avoid conflict in install (#5009)
* fix scoping of Symfony autodiscovery namespace

* scoped: add along phpstan run

* wait longer, the old version is used

* keep phpstan.phar
2020-12-27 21:14:39 +00:00
Tomas Votruba
34a2a497b3
[scoper] symplify prefix pick (#5011)
* use local composer.json for scoped dir

* remove dead directory

* remove dynamic return type extension, not used

* [ci] add along phpstan install

* [scoper] add psr-4 prefixing
2020-12-27 20:31:30 +00:00
TomasVotruba
978fdcdfd8 try symplify scoping 2020-12-27 14:05:05 +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
TomasVotruba
6ed1b26ee7 prefix by date 2020-12-26 12:21:15 +01:00
Tomas Votruba
d4883d44d9
[Prefixed Rector] Add package-scoper approach (#4559) 2020-12-26 00:17:31 +01: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
d256bbd8c0
change rector-ci.php to rector.php (#4994) 2020-12-25 19:11:33 +01:00
Tomas Votruba
a2dbaedb0e
[Privatization] Move MakeUnusedClassesWithChildrenAbstractRector here (#4987) 2020-12-25 15:45:17 +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
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
Tomas Votruba
aa35633c66
use getService() API call over static (#4970) 2020-12-23 21:40:46 +01:00
Abdul Malik Ikhsan
24e17588c1
[Utils] Run validate-fixture-namespace/classname to rules/ directories (#4935) 2020-12-22 18:12:20 +01:00
Tomas Votruba
37b3cecda3
Upgrade to php-parser 4.10.4 and PHPStan 0.12.63 (#4926)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-20 22:05:48 +01:00
Tomas Votruba
574c7cd174
[static] Narrow param types, remove duplicated methods (#4921)
* narrow types and other static fixes

* duplicates static fixes

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-20 13:50:55 +01:00
Abdul Malik Ikhsan
3489c8a9ff
[Utils] Run validate-fixture-namespace/classname to packages (#4902) 2020-12-15 20:40:13 +01:00
Abdul Malik Ikhsan
bf4cd08947
[Utils] Run validate-fixture-namespace and validate-fixture-classname for /tests/ directory (#4901)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-15 19:51:03 +01:00
Tomas Votruba
7e71b94886
dupli (#4885) 2020-12-14 18:24:00 +01:00
Abdul Malik Ikhsan
c2b7297b7a
[DX] Add ValidateFixtureNamespaceCommand and ValidateFixtureClassnameCommand (#4883)
Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-12-14 17:39:16 +01:00
Tomas Votruba
ca353017e2
[Utils] Add OnlyOneClassMethodRule (#4814)
* [Utils] Add OnlyOneClassMethodRule

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-07 00:48:01 +00:00
Tomas Votruba
f672eace0e
[DX] Add init-recipe command to create recipe config in root (#4789)
* [DX] Add init-recipe command to initlaize recipe

* update docs
2020-12-05 13:20:13 +00: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
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
Abdul Malik Ikhsan
4087029cb9
[BetterStandardPrinter] Fixes #4691 Donot convert string literal comment (#4727)
* [BetterStandardPrinter] Fixes #4691 Donot change convert string literal comment

* handle spacing

* [ci-review] Rector Rectify

* fix conflict

* [ci-review] Rector Rectify

* try --debug

* Trigger notification

* phpstan

* phpstan

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-30 09:51:11 +00:00
TomasVotruba
0b3f6446f3 remove duplicated rule in phpstan.neon 2020-11-29 19:00:26 +01:00
Tomas Votruba
0993088cda
[SymfonyPhpConfig] Use Symplify package instead + simplify set validation (#4694)
* [SymfonyPhpConfig] Use Symplify package instead

* [SymfonyPhpConfig] Drop forgotten custom-jobs Rectors

* [CI] simplify set validation

* from inline functions to Static class

* cleanup

* decouple rector.php to allow static analysis and coding standards
2020-11-26 16:44:27 +00:00
Tomas Votruba
0456cc088c
[Docs] Improve rule doc generator to generat rules_overview with categories (#4688)
* numbers

* update ECS config to Symplify 9

* regenerate rules with categorize

* [CI] disable automated rebase, as not working propperly

* update misc
2020-11-25 21:34:34 +00: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
a6bec3d07e
remove RequireClassTypeInClassMethodByTypeRule (#4634) 2020-11-17 12:22:53 +01:00
Tomas Votruba
eeec7d8cb9
rename to RequireClassTypeInClassMethodByTypeRule (#4632) 2020-11-17 02:24:39 +01:00
github-actions[bot]
a1f6027821
[automated] Apply Coding Standard (#4631)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2020-11-17 01:57:48 +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
3b1e31ef8c
[docs] add 10 more relevant node construction examples (#4615) 2020-11-16 20:48:06 +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
Tomas Votruba
3940e42d25 rector update 2020-11-05 02:01:47 +01:00
Tomas Votruba
5147844615
change RenameSpecFileToTestFileRector filesystem to normal one (#4525) 2020-10-31 16:20:30 +00: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
34b4d10ea2
[docs] more node cleanup (#4519)
* [TypeDeclaration] Add better return type coverage

* drop less common node snippets
2020-10-30 21:58:39 +00:00
Tomas Votruba
489efd1adf
[docs] add command for used node stats + simplify node docs, so it uses most needed examples over are nodes (e.g. /=) (#4518) 2020-10-30 22:13:56 +01:00
Tomas Votruba
2c120e283e
Inform about useless second part in tests fixture, after -----, if it is identical (#4514)
* embed skip fixture of same before/after

* [Testing] Add exception on identical second half of the fixture, that should not change

* [ci] use composer 2 for code_analysis

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-30 13:56:55 +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
e845d7cea8
[DoctrineCodeQuality] Add ImproveDoctrineCollectionDocTypeInEntityRector (#4442)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-18 18:29:35 +02:00