56 Commits

Author SHA1 Message Date
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
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
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
TomasVotruba
efb80cf98c typo 2020-12-14 18:43:53 +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
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
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
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
0f2e6d407e
[DoctrineAnnotaitonGenerated] Update to doctrine/annotations 1.11 + fix static (#4479) 2020-10-25 14:43:05 +01:00
Leonardo Losoviz
6f1590efcd
Downgrade Rector to PHP 7.1 - Use same signature for prettyPrintFile as in PrettyPrinterAbstract (#4408)
* Use same signature as in PrettyPrinterAbstract

* Pass array of $nodes to `printNodesToFilePath`

* Use array for $nodes in `printToFile`

* Removed stale logic, fixed phpstan
2020-10-15 09:35:50 +00:00
Tomas Votruba
52ccfc0527
[DX] move Nette FileSytem to SmartFileSystem DI (#4262)
* move Nette FileSytem to SmartFileSystem DI

* move Symfony FileSytem to SmartFileSystem

* [ci] run rector diretly, without composer wrap
2020-09-19 09:27:29 +00:00
Tomas Votruba
2630e1b900
[StaticRemoval] Various fixes (#4245) 2020-09-17 09:34:27 +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
4711abebd1
[RemovingStatic] Add SingleStaticServiceToDynamicRector (#4212)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-13 12:36:29 +02:00
Tomas Votruba
61da1015b0
[RemovingStatic] Do not cause this in static method (#4204) 2020-09-12 00:13:48 +00:00
Tomas Votruba
89e042feb9
[RemovingStatic] Add support for union types (#4203) 2020-09-12 00:25:23 +02:00
dobryy
a6444fb801
[DX] Configurable rule must have configure code sample, and vice versa (#4174)
* [DX] Configurable rule must have configure code sample, and vice versa

* Add ConfiguredCodeSample

* heredocs

* code sample

* fix class

* drop AbstractConfigurableMatchTypeRector

Co-authored-by: TomasVotruba <tomas.vot@gmail.com>
2020-09-11 11:21:48 +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
7cab529bf8
Introduce NodeRepository, single place to get all nodes (#4183)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-10 12:24:43 +02:00
Tomas Votruba
44f383038f
[RemovingStatic] Add LocallyCalledStaticMethodToNonStaticRector (#4181)
* update docs

* [RemovingStatic] Add LocallyCalledStaticMethodToNonStaticRector

* [rector] [RemovingStatic] Add LocallyCalledStaticMethodToNonStaticRector

* [cs] [RemovingStatic] Add LocallyCalledStaticMethodToNonStaticRector

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-10 07:27:03 +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
c1653070f5
[phpstan] Add rule for complex config (#4015)
* [phpstan] Add ForbiddenComplexArrayConfigInSetRule

* add MethodCallRename value object

* [SymfonyPhpConfig] Add array to value object configuration rule

* apply first MethodCallRename value object
2020-08-24 22:26:14 +00:00
Tomas Votruba
33d992497a
[Doctrine] Add constructor getRepository to service (#3954) 2020-08-13 01:04:23 +02:00
Tomas Votruba
1c4b510513
PHPStan: require iterable types (#3936)
* phpstan: require iterable types

* add link on relative path and line

* fix missing class type

* typed array in Rector code + add data provide support resolver

* remove duplicated set

* drop unused yaml ecs config

* add out-of-the-box directory for 3rd party packages

* static fixes

* [rector] static fixes

* [cs] static fixes

* [rector] [cs] static fixes

* generic types

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-11 10:59:04 +00:00
Tomas Votruba
e35131524c
[Nette 3.0] Various rules updates (#3878)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-03 09:26:01 +02:00
Tomas Votruba
e7429d96a4
make use of constant (#3875) 2020-08-02 13:17:33 +00:00
Tomas Votruba
a84528af9e
[Docs] Show constants over values (#3866)
* [docs] decouple RectorCodeSamplePrinter

* decopule printers

* make sure constnat are used in docs

* update docs
2020-08-01 20:55:31 +00:00
TomasVotruba
fe72e003ed use constants in configs 2020-07-30 13:53:53 +02:00
dobryy
f37cd4cac3 [Order] Apply rule 2020-07-26 15:11:41 +02:00
TomasVotruba
7ed4cb19c4 simplify config globs 2020-07-25 20:14:28 +02:00
TomasVotruba
6a4792abf4 apply new naming rule 2020-07-19 23:36:10 +02:00
rector-bot
165845c3e9 fixup! correct names manually back to desired state 2020-07-19 19:35:46 +00:00
TomasVotruba
c1e1053d1c correct names manually back to desired state 2020-07-19 21:32:18 +02:00
TomasVotruba
c2c1066374 [rector] apply on rules 2020-07-19 20:52:42 +02:00
TomasVotruba
0944b75f7e correct namespace in configs 2020-07-18 11:58:17 +02:00
TomasVotruba
0c816d60f8 [config] switch rules config from YAML to PHP 2020-07-16 12:48:54 +02:00
TomasVotruba
ee291d1fdc use strings over ::class in type detection, as they ge tprifexed by phar builder 2020-07-12 16:38:04 +02:00
TomasVotruba
3353bc2ed4 update Fixture splitter class name 2020-07-04 17:23:50 +02:00
TomasVotruba
52acc54005 merge PropertyNaming to one class 2020-07-01 23:42:23 +02:00
TomasVotruba
a8a6e7bcad rename file to fileInfo 2020-06-30 01:45:05 +02:00
TomasVotruba
547e15099d use explicit xBuilder classes to prevent typos and PHPStan and PHPStorm confussion 2020-06-30 01:34:19 +02:00
TomasVotruba
0cb82c2a6f apply new Naming_ 2020-06-30 00:57:38 +02:00
TomasVotruba
7f49658112 change test(string ) to test(SmartFileInfo ) in tests 2020-06-25 20:02:36 +02:00
TomasVotruba
f713c16afd make use of Symplify/EasyTesting 2020-06-25 19:15:40 +02:00
TomasVotruba
c504062ec2 add typed property if on PHP 7.4 2020-06-24 15:09:50 +02:00
TomasVotruba
f0a67edb7e [Nette Kdyby] Add ReplaceEventManagerWithEventSubscriberRector 2020-05-29 01:36:25 +02:00
TomasVotruba
b0bd524e53 apply constant decouple 2020-05-06 23:40:31 +02:00