10735 Commits

Author SHA1 Message Date
Abdul Malik Ikhsan
b82c473e8d
[Downgrade PHP 7.4] Skip DowngradeNumericLiteralSeparatorRector on value contains + char (#5108)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-08 11:17:11 +01:00
Abdul Malik Ikhsan
fe639838d5
[BetterStandardPrinter] Improve duplicate comment handling when duplicated in multi parts (#5107)
* [BetterStandardPrinter] Improve duplicate comment handling when duplicated in multi parts

* clean up

* different comment name fixture

* fix
2021-01-07 20:05:19 +01:00
Abdul Malik Ikhsan
3a2d32c7fa
[BetterStandardPrinter] Failing fixture to not duplicate comment (#5106)
* [BetterStandardPrinter] Failing fixture to not duplicate comment

* Closes #4191

* phpstan
2021-01-07 19:33:27 +01:00
Abdul Malik Ikhsan
524b578628
[PostRector] Skip re-import name on callable name node (#5022)
* [PostRector] Fixes #3383 Skip import name on callable node

* check function_exists()

* fix

* [ci-review] Rector Rectify

* make keep working on existing test

* try use isFoundInUse from ClassNameImportSkipper

* use ClassNameImportSkipper usage

* callable check

* try without is_callable() check

* try using ! function_exists() with \ prefix

* try again with is_callable return early

* fixed

* [ci-review] Rector Rectify

* works?

* fix

* fix

* reduce code complexity

* final touch

* namespace fixture fix

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-07 19:27:31 +01:00
Abdul Malik Ikhsan
b944ee7274
[DeadCode] Failing fixture do not remove variable on comment exists after definition (#5105)
* [DeadCode] Failing fixture do not remove variable on comment exists after definition

* Fixes #5105

* fixture fix
2021-01-07 19:26:15 +01:00
Tomas Votruba
2db8699deb
[CodeQuality] Skip newline (#5103) 2021-01-06 21:10:51 +00:00
Abdul Malik Ikhsan
4622072613
[CodeQuality] Skip ExplicitBoolCompareRector on not variable type (#5101)
* Add failing test fixture for ExplicitBoolCompareRector

# Failing Test for ExplicitBoolCompareRector

Based on https://getrector.org/demo/3cb57eee-954d-4f12-9d0f-7ce703672f60

* Update and rename demo_file.php.inc to UnknownPropertyType.php.inc

* Closes #5100

* fixture

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-06 20:13:48 +01:00
Abdul Malik Ikhsan
756f7dd214
Ensure clean up composer.json & build dir after run coverage weekly (#5099)
* Ensure clean up composer.json after run coverage weekly

as it use require --dev (update composer.json) during run.

* clean build dir as well
2021-01-06 12:08:03 +01:00
Abdul Malik Ikhsan
4f6da168e0
[Nette] Do not Remove Param on RemoveParentAndNameFromComponentConstructorRector when used in Assign (#5098)
* Add failing test fixture for RemoveParentAndNameFromComponentConstructorRector

# Failing Test for RemoveParentAndNameFromComponentConstructorRector

Based on https://getrector.org/demo/12f10dc7-7ffb-4fe1-8004-7bf82e7aa9ce

There are multiple problems in this rule:
1) only $name is removed ($parent should be also removed)
2) $name (and if it would work also $parent) is removed also when there is some future use of it (e.g. assigning to private property $this->name = $name)

* Failing fixtures

* Closes #5052

* cs fix

* rename fixture

* rename fixture

* reduce complexity

* refactor

* use Assign

Co-authored-by: Michal Lulco <michal.lulco@gmail.com>
Co-authored-by: Michal Lulco <lulco@efabrica.sk>
2021-01-06 12:07:13 +01:00
Abdul Malik Ikhsan
ae1e74a89d
[DeadCode] Failing fixture for not removing method parameter used on RemoveUnusedPrivatePropertyRector (#5095)
* [DeadCode] Failing fixture for not removing method parameter used on RemoveUnusedPrivatePropertyRector

* Fixes #5088

* return type

* fixture rename

* use findFirstParentInstanceOf as it may inside another, eg: assign

* phpstan

* clean up

* clean up

* skip construct

* instanceof New_ check

* fix

* final touch

* identifier check

* reduce complexity

* use toString()

* final touch

* php 7.3 syntax
2021-01-06 01:28:51 +00:00
Floris Luiten
39a6b79f30
Fixed typo "lenght" (#5096)
* Fixed typo in docs "lenght" to "length"

* Fixed typo in class constant "lenght" to "length"

* Changed "lenght" instead of "length", fixing bug in class_exists using incorrect classname
2021-01-06 03:06:16 +07:00
Abdul Malik Ikhsan
ff0134b5ca
[CodeQuality] Skip IssetOnPropertyObjectToPropertyExistsRector on null scope (#5094)
* Fixed scope as null on IssetOnPropertyObjectToPropertyExistsRector. Related #5090

* Updated is_null check with !

* Update rules/code-quality/src/Rector/Isset_/IssetOnPropertyObjectToPropertyExistsRector.php

Thanks

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>

* Update rules/code-quality/src/Rector/Isset_/IssetOnPropertyObjectToPropertyExistsRector.php

Thanks!

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>

* Fixes #5090 Closes 5091 reduce code complexity and add fixture

* fixture

* null check

* null check

* reduce complexity

* fixture fix

Co-authored-by: Lito <lito@eordes.com>
2021-01-05 17:26:39 +01:00
Tomáš Fejfar
1281c67510
Fix for #5086 (#5087) 0.9.5 2021-01-04 18:38:50 +01:00
Abdul Malik Ikhsan
1ddaf53bee
[DeadCode] Skip RemoveUnusedPrivatePropertyRector on isset as well (#5085)
* handle isset as well

* method name

* handle under isset

* fix fixture
2021-01-04 18:35:33 +01:00
Tomáš Fejfar
3611457cb6
Publish all tags as docker images (#5086)
No tags except latest were published because tags no longer contain leading `v`
2021-01-04 15:13:23 +01:00
Abdul Malik Ikhsan
e1c89d17f6
[fixtures] Enable validate-fixture-skip-naming check (#5081)
* [fixtures] Enable validate-fixture-skip-naming check

* full path vendor vendor/symplify/easy-testing/bin/easy-testing validate-fixture-skip-naming rules tests

* 21 files

* more fixture

* various fix

* various fix

* more fixtures

* apply to packages rules tests utils

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* fixture fix

* done

* fixture fix
2021-01-04 14:18:27 +01:00
github-actions[bot]
17f47bd5c4
[automated] Re-Generate Nodes/Rectors Documentation (#5082)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-04 14:09:38 +01:00
Abdul Malik Ikhsan
625e3026ff
[DeadCode] Skip RemoveUnusedPrivatePropertyRector on property fetch in unset (#5084)
* [DeadCode] Fixes #5076 Skip RemoveUnusedPrivatePropertyRector on property fetch in unset

* fixture

* phpstan
2021-01-04 14:08:59 +01:00
Tomas Votruba
014c019449
[fixtures] require skip prefix on skipped files (#5079)
* skip unnecesary test case

* namespace corrections, skip prefix corrections

* hide for now

* skip new phpstan cases
2021-01-03 15:54:27 +00:00
Tomas Votruba
e081d8e22c
[DeadCode] Check for child constant usages too (#5077) 0.9.4 2021-01-03 10:44:22 +00:00
Abdul Malik Ikhsan
fab4eb6bdd
[CodeQuality] Do not namespacing "self" on GetClassToInstanceOfRector (#5073) 2021-01-02 23:00:25 +01:00
Abdul Malik Ikhsan
cc20158cf1
[CodingStyle] Add %s for pass PHP_EOL constant on EncapsedStringsToSprintfRector (#5072)
* Add failing test fixture for EncapsedStringsToSprintfRector

# Failing Test for EncapsedStringsToSprintfRector

Based on https://getrector.org/demo/1b647b4f-dde9-4f90-b05e-74744045a3d1

* Fix for prefixed_eol.php.inc

* Check against PHP_EOL

* allowing newline to be prefixed as well

* [CodingStyle] Closes #5060 Fixes #5032 Add %s for pass PHP_EOL constant

* skip multiple eol

* use PHP_EOL const

* [ci-review] Rector Rectify

Co-authored-by: bruce aldridge <bruce@incode.co.nz>
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-02 22:59:58 +01:00
Abdul Malik Ikhsan
e6a4dfdd89
[CodingStyle] Skip dynamic args on UnSpreadOperatorRector (#5070)
* UnSpreadOperatorRector: Should be kept on dynamic method calls

# Failing Test for UnSpreadOperatorRector

Based on https://getrector.org/demo/72c7df1d-01a2-4f1b-923f-2c5dedd7b636

* Closes #5069 Skip dynamic args on UnSpreadOperatorRector

* fixture update

* reduce complexity

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-02 21:28:19 +01:00
Abdul Malik Ikhsan
ec986c1090
[CodeQuality] Do not namespacing "static" on GetClassToInstanceOfRector (#5071)
* Add failing test fixture for GetClassToInstanceOfRector

# Failing Test for GetClassToInstanceOfRector

Based on https://getrector.org/demo/c605ea4b-824c-4fb6-8357-2b71a87098b6

* [CodeQuality] Closes #5064 Do not namespacing "static" on GetClassToInstanceOfRector

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-02 21:27:01 +01:00
Abdul Malik Ikhsan
f5fbeab2b7
[Type Declaration] Skip AddArrayReturnDocTypeRector on return php doc (#5067)
* Add failing test fixture for AddArrayReturnDocTypeRector

Return php doc should not be overriden when is more specific then one inferred by rector. 

# Failing Test for AddArrayReturnDocTypeRector

Based on https://getrector.org/demo/5dc16502-4bb7-4f34-9922-35f56111ae9c

* Create return_php_doc_should_not_be_replaced_by_less_specific_type_2.php.inc

* Update and rename return_php_doc_should_not_be_replaced_by_less_specific_type.php.inc to skip_return_php_doc1.php.inc

* Update and rename return_php_doc_should_not_be_replaced_by_less_specific_type_2.php.inc to skip_return_php_doc2.php.inc

* [Type Declaration] Closes #5028 Skip AddArrayReturnDocTypeRector on return php doc

* add nested case fixture

Co-authored-by: Jan Kuchař <honza@kucharovi.cz>
2021-01-02 17:48:25 +01:00
Abdul Malik Ikhsan
e6dc7c300a
[FlySystem 2.0] Add Upgrade set for MethodCallRename (#5068) 2021-01-02 17:13:59 +01:00
Abdul Malik Ikhsan
6d6abf0bf2
[PHP 7.3] Skip RegexDashEscapeRector double escape (#5066)
* Add failing test fixture for RegexDashEscapeRector

# Failing Test for RegexDashEscapeRector

Based on https://getrector.org/demo/d351fdc0-409a-4f7e-aeb0-a5ee70da2a8b

* [PHP 7.3] Fixes #5055 Closes #5056 Skip RegexDashEscapeRector on escaped

Co-authored-by: Simon Brüchner <powtac@gmx.de>
2021-01-01 23:26:38 +01:00
Tomas Votruba
86aedf2527
[NetteToSymfony] Add new Route class support (#5065) 2021-01-01 20:46:17 +01:00
github-actions[bot]
34c3c3a67c
[automated] Re-Generate Nodes/Rectors Documentation (#5061)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-01 19:59:23 +01:00
github-actions[bot]
54e0210d68
[automated] Apply Coding Standard (#5062)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-01 19:54:49 +01:00
Abdul Malik Ikhsan
1c26598518
[CodingStyle] Register UnSpreadOperatorRector to coding-style config set (#5050) 2020-12-31 14:28:58 +01:00
Abdul Malik Ikhsan
7192385c49
[CI] Remove fork check in daily and weekly CI (#5058) 2020-12-31 14:27:44 +01:00
Grzegorz Korba
7a82928e08
Skip variadic arguments from property promotion (#5046) 2020-12-30 20:31:55 +01:00
Abdul Malik Ikhsan
bf9e31b515
[Test] Separate Weekly CI for code coverage generation (#5044) 2020-12-29 23:48:07 +01:00
Tomas Votruba
6ddb4effd8
[PHPStanStaticTypeMapper] Add closure conversion (#5043) 2020-12-29 21:22:48 +00:00
Abdul Malik Ikhsan
81751880b2
[Test] Move Re-generate code coverage to weekly pull request (#5041) 2020-12-29 19:08:24 +01: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
Grzegorz Korba
a43d3e3863
Lower requirement for phpstan/phpdoc-parser (#5039) 0.9.3 2020-12-29 16:09:15 +01:00
Abdul Malik Ikhsan
fba0bac3f8
[Github Action] Move fork check in steps for daily and weekly pull request (#5036) 2020-12-29 15:23:12 +01:00
Tomas Votruba
59b71e04a3
respect PHPStan descission to drop & in param docs (#5035)
* revert phpdoc support for reference in params

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-29 11:12:32 +00:00
Abdul Malik Ikhsan
c594dc540e
[Test] Add utils/ to whitelist test coverage (#5034)
* [Test] Add utils/ to whitelist test coverage

* back to on push trigger
2020-12-29 11:25:45 +01:00
Tomas Votruba
630c3d324e
[PhpVersionResolver] Add project composer.json as source + decouple to composer json fatcory (#5031)
* [PhpVersionResolver] Add project composer.json as source + decouple to composer json fatcory

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-29 00:32:48 +00:00
Michal Lulco
fee81507bb
Do not prefix Symplify\SymfonyPhpConfig (#5030) 2020-12-29 01:17:46 +01:00
Tomas Votruba
c7140076ec
use clone const (#5029) 2020-12-28 23:38:05 +00:00
TomasVotruba
3f07620ef1 unprefix Symplify/RuleDocGeneator 0.9.2 2020-12-28 23:11:17 +01:00
TomasVotruba
f58deedbee drop debug build 2020-12-28 23:09:30 +01:00
Tomas Votruba
52e604c6dd
[scoper] unprefix string classes to match types (#5025) 2020-12-28 23:09:11 +01:00
Abdul Malik Ikhsan
acdc7ee6ee
[PHPUnit] Enable Coverage again (#5007)
* [PHPUnit] Enable Coverage again

* coverals

* try using pcov

* use code_coverage.yaml

* on pull request

* try with --testsuite main

* try create multiple suites and use phpcov to merge clover

* try create multiple suites and use phpcov to merge clover

* try create multiple suites and use phpcov to merge clover

* chmod +x ./phpcov.phar

* using --coverage-php for generate .cov

* surplus -

* debug

* tempoary disable collect test on utils

* try exclude packages/attribute-aware-php-doc/src/Ast/PhpDoc/AttributeAwareDeprecatedTagValueNode.php

* try exclude packages/attribute-aware-php-doc/src/Ast/PhpDoc/AttributeAwareDeprecatedTagValueNode.php

* try nimut/phpunit-merger

* using ./ for directory

* exclude directories

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* try run phpunit on explicit directory

* try using xdebug

* reverted even on push
2020-12-28 19:46:48 +00:00
TomasVotruba
7176cd62f8 remove dead half fetch 2020-12-28 19:20:40 +01:00
Tomas Votruba
cdf3c97b60
[RectorGenerator] Test interactive generator (#5023)
* apply cs

* [RectorGenerator] Add compare dir test for interactive mode

* add PackageNamesProviderTest

* add NodeTypesProviderTest

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-28 18:20:12 +00:00