From 2f6aa26f2b9c07fc3b5ad2e2a8af6648c2d40664 Mon Sep 17 00:00:00 2001 From: Firdaus Zahari Date: Sun, 21 Jan 2024 19:37:06 +0800 Subject: [PATCH] Initial commit --- .editorconfig | 15 + .gitattributes | 7 + .github/workflows/code_quality.yaml | 51 + .gitignore | 4 + README.md | 26 + composer.json | 44 + composer.lock | 2023 +++++++++++++++++ config/sets/level/up-to-wp-0.71.php | 8 + config/sets/level/up-to-wp-1.0.php | 9 + config/sets/level/up-to-wp-1.2.php | 9 + config/sets/level/up-to-wp-1.5.php | 9 + config/sets/level/up-to-wp-2.0.php | 9 + config/sets/level/up-to-wp-2.1.php | 9 + config/sets/level/up-to-wp-2.2.php | 9 + config/sets/level/up-to-wp-2.3.php | 9 + config/sets/level/up-to-wp-2.5.php | 9 + config/sets/level/up-to-wp-2.6.php | 9 + config/sets/level/up-to-wp-2.7.php | 9 + config/sets/level/up-to-wp-2.8.php | 9 + config/sets/level/up-to-wp-2.9.php | 9 + config/sets/level/up-to-wp-3.0.php | 9 + config/sets/level/up-to-wp-3.1.php | 9 + config/sets/level/up-to-wp-3.2.php | 9 + config/sets/level/up-to-wp-3.3.php | 9 + config/sets/level/up-to-wp-3.4.php | 9 + config/sets/level/up-to-wp-3.5.php | 9 + config/sets/level/up-to-wp-3.6.php | 9 + config/sets/level/up-to-wp-3.7.php | 9 + config/sets/level/up-to-wp-3.8.php | 9 + config/sets/level/up-to-wp-3.9.php | 9 + config/sets/level/up-to-wp-4.0.php | 9 + config/sets/level/up-to-wp-4.1.php | 9 + config/sets/level/up-to-wp-4.2.php | 9 + config/sets/level/up-to-wp-4.3.php | 9 + config/sets/level/up-to-wp-4.4.php | 9 + config/sets/level/up-to-wp-4.5.php | 9 + config/sets/level/up-to-wp-4.6.php | 9 + config/sets/level/up-to-wp-4.7.php | 9 + config/sets/level/up-to-wp-4.8.php | 9 + config/sets/level/up-to-wp-4.9.php | 9 + config/sets/level/up-to-wp-5.0.php | 9 + config/sets/level/up-to-wp-5.1.php | 9 + config/sets/level/up-to-wp-5.2.php | 9 + config/sets/level/up-to-wp-5.3.php | 9 + config/sets/level/up-to-wp-5.4.php | 9 + config/sets/level/up-to-wp-5.5.php | 9 + config/sets/level/up-to-wp-5.6.php | 9 + config/sets/level/up-to-wp-5.7.php | 9 + config/sets/level/up-to-wp-5.8.php | 9 + config/sets/level/up-to-wp-5.9.php | 9 + config/sets/level/up-to-wp-6.0.php | 9 + config/sets/level/up-to-wp-6.1.php | 9 + config/sets/level/up-to-wp-6.2.php | 9 + config/sets/level/up-to-wp-6.3.php | 9 + config/sets/level/up-to-wp-6.4.php | 9 + config/sets/wp-0.71.php | 22 + config/sets/wp-1.0.php | 5 + config/sets/wp-1.2.php | 17 + config/sets/wp-1.5.php | 26 + config/sets/wp-2.0.php | 30 + config/sets/wp-2.1.php | 74 + config/sets/wp-2.2.php | 16 + config/sets/wp-2.3.php | 27 + config/sets/wp-2.5.php | 48 + config/sets/wp-2.6.php | 16 + config/sets/wp-2.7.php | 39 + config/sets/wp-2.8.php | 102 + config/sets/wp-2.9.php | 17 + config/sets/wp-3.0.php | 90 + config/sets/wp-3.1.php | 50 + config/sets/wp-3.2.php | 24 + config/sets/wp-3.3.php | 88 + config/sets/wp-3.4.php | 59 + config/sets/wp-3.5.php | 104 + config/sets/wp-3.6.php | 32 + config/sets/wp-3.7.php | 27 + config/sets/wp-3.8.php | 32 + config/sets/wp-3.9.php | 25 + config/sets/wp-4.0.php | 45 + config/sets/wp-4.1.php | 13 + config/sets/wp-4.2.php | 19 + config/sets/wp-4.3.php | 50 + config/sets/wp-4.4.php | 33 + config/sets/wp-4.5.php | 54 + config/sets/wp-4.6.php | 29 + config/sets/wp-4.7.php | 75 + config/sets/wp-4.8.php | 18 + config/sets/wp-4.9.php | 54 + config/sets/wp-5.0.php | 5 + config/sets/wp-5.1.php | 26 + config/sets/wp-5.2.php | 11 + config/sets/wp-5.3.php | 60 + config/sets/wp-5.4.php | 25 + config/sets/wp-5.5.php | 43 + config/sets/wp-5.6.php | 29 + config/sets/wp-5.7.php | 21 + config/sets/wp-5.8.php | 23 + config/sets/wp-5.9.php | 39 + config/sets/wp-6.0.php | 28 + config/sets/wp-6.1.php | 38 + config/sets/wp-6.2.php | 24 + config/sets/wp-6.3.php | 58 + config/sets/wp-6.4.php | 34 + phpstan.neon | 17 + phpunit.xml | 15 + pint.json | 239 ++ rector.php | 23 + .../ConstFetch/ConstToFuncCallRector.php | 75 + .../Deprecated/Functions/TheEditorRector.php | 61 + .../Functions/WpKsesJsEntitiesRector.php | 53 + src/Rules/FuncCall/ParameterAdderRector.php | 74 + .../FuncCall/ParameterPrependerRector.php | 73 + .../FuncCall/ReturnFirstArgumentRector.php | 68 + src/Rules/MethodCall/ParameterAdderRector.php | 124 + .../MethodCall/RemoveMethodCallRector.php | 91 + .../MethodCall/ReturnFirstArgumentRector.php | 88 + src/Set/WordPressLevelSetList.php | 104 + src/Set/WordPressSetList.php | 104 + src/ValueObject/FunctionParameterAdder.php | 23 + .../FunctionParameterPrepender.php | 18 + src/ValueObject/MethodParameterAdder.php | 30 + .../ConstToFuncCallRectorTest.php | 29 + .../ConstToFuncCallRector/config.php | 10 + .../test_fixture.php.inc | 11 + .../TheEditorRector/TheEditorRectorTest.php | 29 + .../Functions/TheEditorRector/config.php | 8 + .../TheEditorRector/test_fixture.php.inc | 19 + .../WpKsesJsEntitiesRectorTest.php | 29 + .../WpKsesJsEntitiesRector/config.php | 8 + .../test_fixture.php.inc | 13 + .../ParameterAdderRectorTest.php | 29 + .../FuncCall/ParameterAdderRector/config.php | 12 + .../ParameterAdderRector/test_fixture.php.inc | 11 + .../ParameterPrependerRectorTest.php | 29 + .../ParameterPrependerRector/config.php | 11 + .../test_fixture.php.inc | 11 + .../ReturnFirstArgumentRectorTest.php | 29 + .../ReturnFirstArgumentRector/config.php | 10 + .../test_fixture.php.inc | 29 + .../ParameterAdderRectorTest.php | 29 + .../ParameterAdderRector/config.php | 13 + .../ParameterAdderRector/test_fixture.php.inc | 21 + .../RemoveMethodCallRectorTest.php | 29 + .../RemoveMethodCallRector/config.php | 10 + .../test_fixture.php.inc | 14 + .../ReturnFirstArgumentRectorTest.php | 29 + .../ReturnFirstArgumentRector/config.php | 10 + .../test_fixture.php.inc | 13 + tests/Rector/Sets/Wp071/Wp071Test.php | 29 + tests/Rector/Sets/Wp071/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp10/Wp10Test.php | 29 + tests/Rector/Sets/Wp10/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp12/Wp12Test.php | 29 + tests/Rector/Sets/Wp12/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp15/Wp15Test.php | 29 + tests/Rector/Sets/Wp15/test_fixture.php.inc | 13 + tests/Rector/Sets/Wp20/Wp20Test.php | 29 + tests/Rector/Sets/Wp20/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp21/Wp21Test.php | 29 + tests/Rector/Sets/Wp21/test_fixture.php.inc | 27 + tests/Rector/Sets/Wp22/Wp22Test.php | 29 + tests/Rector/Sets/Wp22/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp23/Wp23Test.php | 29 + tests/Rector/Sets/Wp23/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp25/Wp25Test.php | 29 + tests/Rector/Sets/Wp25/test_fixture.php.inc | 23 + tests/Rector/Sets/Wp26/Wp26Test.php | 29 + tests/Rector/Sets/Wp26/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp27/Wp27Test.php | 29 + tests/Rector/Sets/Wp27/test_fixture.php.inc | 17 + tests/Rector/Sets/Wp28/Wp28Test.php | 29 + tests/Rector/Sets/Wp28/test_fixture.php.inc | 85 + tests/Rector/Sets/Wp29/Wp29Test.php | 29 + tests/Rector/Sets/Wp29/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp30/Wp30Test.php | 29 + tests/Rector/Sets/Wp30/test_fixture.php.inc | 74 + tests/Rector/Sets/Wp31/Wp31Test.php | 29 + tests/Rector/Sets/Wp31/test_fixture.php.inc | 25 + tests/Rector/Sets/Wp32/Wp32Test.php | 29 + tests/Rector/Sets/Wp32/test_fixture.php.inc | 17 + tests/Rector/Sets/Wp33/Wp33Test.php | 29 + tests/Rector/Sets/Wp33/test_fixture.php.inc | 63 + tests/Rector/Sets/Wp34/Wp34Test.php | 29 + tests/Rector/Sets/Wp34/test_fixture.php.inc | 34 + tests/Rector/Sets/Wp35/Wp35Test.php | 29 + tests/Rector/Sets/Wp35/test_fixture.php.inc | 65 + tests/Rector/Sets/Wp36/Wp36Test.php | 29 + tests/Rector/Sets/Wp36/test_fixture.php.inc | 22 + tests/Rector/Sets/Wp37/Wp37Test.php | 29 + tests/Rector/Sets/Wp37/test_fixture.php.inc | 12 + tests/Rector/Sets/Wp38/Wp38Test.php | 29 + tests/Rector/Sets/Wp38/test_fixture.php.inc | 20 + tests/Rector/Sets/Wp39/Wp39Test.php | 29 + tests/Rector/Sets/Wp39/test_fixture.php.inc | 17 + tests/Rector/Sets/Wp40/Wp40Test.php | 29 + tests/Rector/Sets/Wp40/test_fixture.php.inc | 27 + tests/Rector/Sets/Wp41/Wp41Test.php | 29 + tests/Rector/Sets/Wp41/test_fixture.php.inc | 20 + tests/Rector/Sets/Wp42/Wp42Test.php | 29 + tests/Rector/Sets/Wp42/test_fixture.php.inc | 24 + tests/Rector/Sets/Wp43/Wp43Test.php | 29 + tests/Rector/Sets/Wp43/test_fixture.php.inc | 29 + tests/Rector/Sets/Wp44/Wp44Test.php | 29 + tests/Rector/Sets/Wp44/test_fixture.php.inc | 31 + tests/Rector/Sets/Wp45/Wp45Test.php | 29 + tests/Rector/Sets/Wp45/test_fixture.php.inc | 42 + tests/Rector/Sets/Wp46/Wp46Test.php | 29 + tests/Rector/Sets/Wp46/test_fixture.php.inc | 15 + tests/Rector/Sets/Wp47/Wp47Test.php | 29 + tests/Rector/Sets/Wp47/test_fixture.php.inc | 44 + tests/Rector/Sets/Wp48/Wp48Test.php | 29 + tests/Rector/Sets/Wp48/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp49/Wp49Test.php | 29 + tests/Rector/Sets/Wp49/test_fixture.php.inc | 25 + tests/Rector/Sets/Wp50/Wp50Test.php | 29 + tests/Rector/Sets/Wp50/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp51/Wp51Test.php | 29 + tests/Rector/Sets/Wp51/test_fixture.php.inc | 12 + tests/Rector/Sets/Wp52/Wp52Test.php | 29 + tests/Rector/Sets/Wp52/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp53/Wp53Test.php | 29 + tests/Rector/Sets/Wp53/test_fixture.php.inc | 16 + tests/Rector/Sets/Wp54/Wp54Test.php | 29 + tests/Rector/Sets/Wp54/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp55/Wp55Test.php | 29 + tests/Rector/Sets/Wp55/test_fixture.php.inc | 31 + tests/Rector/Sets/Wp56/Wp56Test.php | 29 + tests/Rector/Sets/Wp56/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp57/Wp57Test.php | 29 + tests/Rector/Sets/Wp57/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp58/Wp58Test.php | 29 + tests/Rector/Sets/Wp58/test_fixture.php.inc | 19 + tests/Rector/Sets/Wp59/Wp59Test.php | 29 + tests/Rector/Sets/Wp59/test_fixture.php.inc | 17 + tests/Rector/Sets/Wp60/Wp60Test.php | 29 + tests/Rector/Sets/Wp60/test_fixture.php.inc | 13 + tests/Rector/Sets/Wp61/Wp61Test.php | 29 + tests/Rector/Sets/Wp61/test_fixture.php.inc | 37 + tests/Rector/Sets/Wp62/Wp62Test.php | 29 + tests/Rector/Sets/Wp62/test_fixture.php.inc | 11 + tests/Rector/Sets/Wp63/Wp63Test.php | 29 + tests/Rector/Sets/Wp63/test_fixture.php.inc | 36 + tests/Rector/Sets/Wp64/Wp64Test.php | 29 + tests/Rector/Sets/Wp64/test_fixture.php.inc | 25 + 244 files changed, 8734 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/code_quality.yaml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 config/sets/level/up-to-wp-0.71.php create mode 100644 config/sets/level/up-to-wp-1.0.php create mode 100644 config/sets/level/up-to-wp-1.2.php create mode 100644 config/sets/level/up-to-wp-1.5.php create mode 100644 config/sets/level/up-to-wp-2.0.php create mode 100644 config/sets/level/up-to-wp-2.1.php create mode 100644 config/sets/level/up-to-wp-2.2.php create mode 100644 config/sets/level/up-to-wp-2.3.php create mode 100644 config/sets/level/up-to-wp-2.5.php create mode 100644 config/sets/level/up-to-wp-2.6.php create mode 100644 config/sets/level/up-to-wp-2.7.php create mode 100644 config/sets/level/up-to-wp-2.8.php create mode 100644 config/sets/level/up-to-wp-2.9.php create mode 100644 config/sets/level/up-to-wp-3.0.php create mode 100644 config/sets/level/up-to-wp-3.1.php create mode 100644 config/sets/level/up-to-wp-3.2.php create mode 100644 config/sets/level/up-to-wp-3.3.php create mode 100644 config/sets/level/up-to-wp-3.4.php create mode 100644 config/sets/level/up-to-wp-3.5.php create mode 100644 config/sets/level/up-to-wp-3.6.php create mode 100644 config/sets/level/up-to-wp-3.7.php create mode 100644 config/sets/level/up-to-wp-3.8.php create mode 100644 config/sets/level/up-to-wp-3.9.php create mode 100644 config/sets/level/up-to-wp-4.0.php create mode 100644 config/sets/level/up-to-wp-4.1.php create mode 100644 config/sets/level/up-to-wp-4.2.php create mode 100644 config/sets/level/up-to-wp-4.3.php create mode 100644 config/sets/level/up-to-wp-4.4.php create mode 100644 config/sets/level/up-to-wp-4.5.php create mode 100644 config/sets/level/up-to-wp-4.6.php create mode 100644 config/sets/level/up-to-wp-4.7.php create mode 100644 config/sets/level/up-to-wp-4.8.php create mode 100644 config/sets/level/up-to-wp-4.9.php create mode 100644 config/sets/level/up-to-wp-5.0.php create mode 100644 config/sets/level/up-to-wp-5.1.php create mode 100644 config/sets/level/up-to-wp-5.2.php create mode 100644 config/sets/level/up-to-wp-5.3.php create mode 100644 config/sets/level/up-to-wp-5.4.php create mode 100644 config/sets/level/up-to-wp-5.5.php create mode 100644 config/sets/level/up-to-wp-5.6.php create mode 100644 config/sets/level/up-to-wp-5.7.php create mode 100644 config/sets/level/up-to-wp-5.8.php create mode 100644 config/sets/level/up-to-wp-5.9.php create mode 100644 config/sets/level/up-to-wp-6.0.php create mode 100644 config/sets/level/up-to-wp-6.1.php create mode 100644 config/sets/level/up-to-wp-6.2.php create mode 100644 config/sets/level/up-to-wp-6.3.php create mode 100644 config/sets/level/up-to-wp-6.4.php create mode 100644 config/sets/wp-0.71.php create mode 100644 config/sets/wp-1.0.php create mode 100644 config/sets/wp-1.2.php create mode 100644 config/sets/wp-1.5.php create mode 100644 config/sets/wp-2.0.php create mode 100644 config/sets/wp-2.1.php create mode 100644 config/sets/wp-2.2.php create mode 100644 config/sets/wp-2.3.php create mode 100644 config/sets/wp-2.5.php create mode 100644 config/sets/wp-2.6.php create mode 100644 config/sets/wp-2.7.php create mode 100644 config/sets/wp-2.8.php create mode 100644 config/sets/wp-2.9.php create mode 100644 config/sets/wp-3.0.php create mode 100644 config/sets/wp-3.1.php create mode 100644 config/sets/wp-3.2.php create mode 100644 config/sets/wp-3.3.php create mode 100644 config/sets/wp-3.4.php create mode 100644 config/sets/wp-3.5.php create mode 100644 config/sets/wp-3.6.php create mode 100644 config/sets/wp-3.7.php create mode 100644 config/sets/wp-3.8.php create mode 100644 config/sets/wp-3.9.php create mode 100644 config/sets/wp-4.0.php create mode 100644 config/sets/wp-4.1.php create mode 100644 config/sets/wp-4.2.php create mode 100644 config/sets/wp-4.3.php create mode 100644 config/sets/wp-4.4.php create mode 100644 config/sets/wp-4.5.php create mode 100644 config/sets/wp-4.6.php create mode 100644 config/sets/wp-4.7.php create mode 100644 config/sets/wp-4.8.php create mode 100644 config/sets/wp-4.9.php create mode 100644 config/sets/wp-5.0.php create mode 100644 config/sets/wp-5.1.php create mode 100644 config/sets/wp-5.2.php create mode 100644 config/sets/wp-5.3.php create mode 100644 config/sets/wp-5.4.php create mode 100644 config/sets/wp-5.5.php create mode 100644 config/sets/wp-5.6.php create mode 100644 config/sets/wp-5.7.php create mode 100644 config/sets/wp-5.8.php create mode 100644 config/sets/wp-5.9.php create mode 100644 config/sets/wp-6.0.php create mode 100644 config/sets/wp-6.1.php create mode 100644 config/sets/wp-6.2.php create mode 100644 config/sets/wp-6.3.php create mode 100644 config/sets/wp-6.4.php create mode 100644 phpstan.neon create mode 100644 phpunit.xml create mode 100644 pint.json create mode 100644 rector.php create mode 100644 src/Rules/ConstFetch/ConstToFuncCallRector.php create mode 100644 src/Rules/Deprecated/Functions/TheEditorRector.php create mode 100644 src/Rules/Deprecated/Functions/WpKsesJsEntitiesRector.php create mode 100644 src/Rules/FuncCall/ParameterAdderRector.php create mode 100644 src/Rules/FuncCall/ParameterPrependerRector.php create mode 100644 src/Rules/FuncCall/ReturnFirstArgumentRector.php create mode 100644 src/Rules/MethodCall/ParameterAdderRector.php create mode 100644 src/Rules/MethodCall/RemoveMethodCallRector.php create mode 100644 src/Rules/MethodCall/ReturnFirstArgumentRector.php create mode 100644 src/Set/WordPressLevelSetList.php create mode 100644 src/Set/WordPressSetList.php create mode 100644 src/ValueObject/FunctionParameterAdder.php create mode 100644 src/ValueObject/FunctionParameterPrepender.php create mode 100644 src/ValueObject/MethodParameterAdder.php create mode 100644 tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/ConstToFuncCallRectorTest.php create mode 100644 tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/config.php create mode 100644 tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/Deprecated/Functions/TheEditorRector/TheEditorRectorTest.php create mode 100644 tests/Rector/Rules/Deprecated/Functions/TheEditorRector/config.php create mode 100644 tests/Rector/Rules/Deprecated/Functions/TheEditorRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/WpKsesJsEntitiesRectorTest.php create mode 100644 tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/config.php create mode 100644 tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/FuncCall/ParameterAdderRector/ParameterAdderRectorTest.php create mode 100644 tests/Rector/Rules/FuncCall/ParameterAdderRector/config.php create mode 100644 tests/Rector/Rules/FuncCall/ParameterAdderRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/FuncCall/ParameterPrependerRector/ParameterPrependerRectorTest.php create mode 100644 tests/Rector/Rules/FuncCall/ParameterPrependerRector/config.php create mode 100644 tests/Rector/Rules/FuncCall/ParameterPrependerRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php create mode 100644 tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/config.php create mode 100644 tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/MethodCall/ParameterAdderRector/ParameterAdderRectorTest.php create mode 100644 tests/Rector/Rules/MethodCall/ParameterAdderRector/config.php create mode 100644 tests/Rector/Rules/MethodCall/ParameterAdderRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/MethodCall/RemoveMethodCallRector/RemoveMethodCallRectorTest.php create mode 100644 tests/Rector/Rules/MethodCall/RemoveMethodCallRector/config.php create mode 100644 tests/Rector/Rules/MethodCall/RemoveMethodCallRector/test_fixture.php.inc create mode 100644 tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php create mode 100644 tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/config.php create mode 100644 tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp071/Wp071Test.php create mode 100644 tests/Rector/Sets/Wp071/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp10/Wp10Test.php create mode 100644 tests/Rector/Sets/Wp10/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp12/Wp12Test.php create mode 100644 tests/Rector/Sets/Wp12/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp15/Wp15Test.php create mode 100644 tests/Rector/Sets/Wp15/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp20/Wp20Test.php create mode 100644 tests/Rector/Sets/Wp20/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp21/Wp21Test.php create mode 100644 tests/Rector/Sets/Wp21/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp22/Wp22Test.php create mode 100644 tests/Rector/Sets/Wp22/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp23/Wp23Test.php create mode 100644 tests/Rector/Sets/Wp23/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp25/Wp25Test.php create mode 100644 tests/Rector/Sets/Wp25/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp26/Wp26Test.php create mode 100644 tests/Rector/Sets/Wp26/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp27/Wp27Test.php create mode 100644 tests/Rector/Sets/Wp27/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp28/Wp28Test.php create mode 100644 tests/Rector/Sets/Wp28/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp29/Wp29Test.php create mode 100644 tests/Rector/Sets/Wp29/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp30/Wp30Test.php create mode 100644 tests/Rector/Sets/Wp30/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp31/Wp31Test.php create mode 100644 tests/Rector/Sets/Wp31/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp32/Wp32Test.php create mode 100644 tests/Rector/Sets/Wp32/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp33/Wp33Test.php create mode 100644 tests/Rector/Sets/Wp33/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp34/Wp34Test.php create mode 100644 tests/Rector/Sets/Wp34/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp35/Wp35Test.php create mode 100644 tests/Rector/Sets/Wp35/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp36/Wp36Test.php create mode 100644 tests/Rector/Sets/Wp36/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp37/Wp37Test.php create mode 100644 tests/Rector/Sets/Wp37/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp38/Wp38Test.php create mode 100644 tests/Rector/Sets/Wp38/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp39/Wp39Test.php create mode 100644 tests/Rector/Sets/Wp39/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp40/Wp40Test.php create mode 100644 tests/Rector/Sets/Wp40/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp41/Wp41Test.php create mode 100644 tests/Rector/Sets/Wp41/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp42/Wp42Test.php create mode 100644 tests/Rector/Sets/Wp42/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp43/Wp43Test.php create mode 100644 tests/Rector/Sets/Wp43/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp44/Wp44Test.php create mode 100644 tests/Rector/Sets/Wp44/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp45/Wp45Test.php create mode 100644 tests/Rector/Sets/Wp45/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp46/Wp46Test.php create mode 100644 tests/Rector/Sets/Wp46/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp47/Wp47Test.php create mode 100644 tests/Rector/Sets/Wp47/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp48/Wp48Test.php create mode 100644 tests/Rector/Sets/Wp48/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp49/Wp49Test.php create mode 100644 tests/Rector/Sets/Wp49/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp50/Wp50Test.php create mode 100644 tests/Rector/Sets/Wp50/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp51/Wp51Test.php create mode 100644 tests/Rector/Sets/Wp51/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp52/Wp52Test.php create mode 100644 tests/Rector/Sets/Wp52/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp53/Wp53Test.php create mode 100644 tests/Rector/Sets/Wp53/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp54/Wp54Test.php create mode 100644 tests/Rector/Sets/Wp54/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp55/Wp55Test.php create mode 100644 tests/Rector/Sets/Wp55/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp56/Wp56Test.php create mode 100644 tests/Rector/Sets/Wp56/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp57/Wp57Test.php create mode 100644 tests/Rector/Sets/Wp57/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp58/Wp58Test.php create mode 100644 tests/Rector/Sets/Wp58/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp59/Wp59Test.php create mode 100644 tests/Rector/Sets/Wp59/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp60/Wp60Test.php create mode 100644 tests/Rector/Sets/Wp60/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp61/Wp61Test.php create mode 100644 tests/Rector/Sets/Wp61/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp62/Wp62Test.php create mode 100644 tests/Rector/Sets/Wp62/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp63/Wp63Test.php create mode 100644 tests/Rector/Sets/Wp63/test_fixture.php.inc create mode 100644 tests/Rector/Sets/Wp64/Wp64Test.php create mode 100644 tests/Rector/Sets/Wp64/test_fixture.php.inc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..83ff9b6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.yaml] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f0e2f96 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +pint.json export-ignore +phpstan.neon export-ignore +phpunit.xml export-ignore +tests export-ignore diff --git a/.github/workflows/code_quality.yaml b/.github/workflows/code_quality.yaml new file mode 100644 index 0000000..0edbcd6 --- /dev/null +++ b/.github/workflows/code_quality.yaml @@ -0,0 +1,51 @@ +name: Code Analysis + +on: + pull_request: + push: + branches: + - main + +env: + COMPOSER_ROOT_VERSION: "dev-main" + +jobs: + code_analysis: + runs-on: ubuntu-latest + + strategy: + matrix: + actions: + - + name: 'Composer Validate' + run: composer validate + + - + name: 'Pint' + run: composer pint-test + + - + name: 'Rector Dry Run' + run: composer rector-dry-run + + - + name: 'PHPStan' + run: composer phpstan + + - + name: 'PHPUnit' + run: composer phpunit + + name: ${{ matrix.actions.name }} + + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + coverage: none + + - uses: ramsey/composer-install@v2 + + - run: ${{ matrix.actions.run }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb527ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/vendor +.idea/ +.phpunit.result.cache +.phpunit.cache diff --git a/README.md b/README.md new file mode 100644 index 0000000..41f204b --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Rector Rules for WordPress + +This package is a [Rector](https://github.com/rectorphp/rector) extension developed to provide upgrades rules for WordPress. + +## Install + +Install the `rector-wordpress` package as dependency: + +```bash +composer require fsylum/rector-wordpress --dev +``` + +## Use Sets + +To add a set to your config, use `Fsylum\RectorWordPress\Set\WordPressSetList` class and pick one of the constants: + +```php +use Fsylum\RectorWordPress\Set\WordPressSetList; +use Rector\Config\RectorConfig; + +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([ + WordPressSetList::WP_6_4 + ]); +}; +``` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4767c8a --- /dev/null +++ b/composer.json @@ -0,0 +1,44 @@ +{ + "name": "fsylum/rector-wordpress", + "description": "Rector upgrades rules for WordPress", + "type": "rector-extension", + "license": "MIT", + "autoload": { + "psr-4": { + "Fsylum\\RectorWordPress\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Fsylum\\RectorWordPress\\Tests\\": "tests" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=8.2", + "rector/rector": "^0.19.2" + }, + "require-dev": { + "phpunit/phpunit": "^10.5", + "phpstan/phpstan": "^1.10", + "laravel/pint": "^1.13", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpstan/phpstan-strict-rules": "^1.5", + "webmozart/assert": "^1.11" + }, + "scripts": { + "phpstan": "vendor/bin/phpstan analyse --ansi", + "phpunit": "vendor/bin/phpunit tests", + "pint-test": "vendor/bin/pint --test", + "pint": "vendor/bin/pint", + "rector-dry-run": "vendor/bin/rector process --dry-run --ansi", + "rector": "vendor/bin/rector process --ansi" + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..1c2be4f --- /dev/null +++ b/composer.lock @@ -0,0 +1,2023 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "b0ef8368e75de12327941b808820b590", + "packages": [ + { + "name": "phpstan/phpstan", + "version": "1.10.56", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "27816a01aea996191ee14d010f325434c0ee76fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/27816a01aea996191ee14d010f325434c0ee76fa", + "reference": "27816a01aea996191ee14d010f325434c0ee76fa", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2024-01-15T10:43:00+00:00" + }, + { + "name": "rector/rector", + "version": "0.19.2", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "bc96a99895bf47c6bfe70ea1b799f0081ed5a903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/bc96a99895bf47c6bfe70ea1b799f0081ed5a903", + "reference": "bc96a99895bf47c6bfe70ea1b799f0081ed5a903", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.10.56" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/0.19.2" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-01-19T10:58:30+00:00" + } + ], + "packages-dev": [ + { + "name": "laravel/pint", + "version": "v1.13.9", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "e3e269cc5d874c8efd2dc7962b1c7ff2585fe525" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/e3e269cc5d874c8efd2dc7962b1c7ff2585fe525", + "reference": "e3e269cc5d874c8efd2dc7962b1c7ff2585fe525", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.47.0", + "illuminate/view": "^10.40.0", + "larastan/larastan": "^2.8.1", + "laravel-zero/framework": "^10.3.0", + "mockery/mockery": "^1.6.7", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.31.0" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2024-01-16T17:39:29+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.0.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" + }, + "time": "2024-01-07T17:17:35+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpstan/extension-installer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.3.1" + }, + "time": "2023-05-24T08:59:17+00:00" + }, + { + "name": "phpstan/phpstan-strict-rules", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/7a50e9662ee9f3942e4aaaf3d603653f60282542", + "reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.10.34" + }, + "require-dev": { + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Extra strict and opinionated rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.2" + }, + "time": "2023-10-30T14:35:06+00:00" + }, + { + "name": "phpstan/phpstan-webmozart-assert", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-webmozart-assert.git", + "reference": "d1ff28697bd4e1c9ef5d3f871367ce9092871fec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/d1ff28697bd4e1c9ef5d3f871367ce9092871fec", + "reference": "d1ff28697bd4e1c9ef5d3f871367ce9092871fec", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.10" + }, + "require-dev": { + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "webmozart/assert": "^1.11.0" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan webmozart/assert extension", + "support": { + "issues": "https://github.com/phpstan/phpstan-webmozart-assert/issues", + "source": "https://github.com/phpstan/phpstan-webmozart-assert/tree/1.2.4" + }, + "time": "2023-02-21T20:34:19+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "10.1.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T15:38:30+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.5.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "08f4fa74d5fbfff1ef22abffee47aaedcaea227e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/08f4fa74d5fbfff1ef22abffee47aaedcaea227e", + "reference": "08f4fa74d5fbfff1ef22abffee47aaedcaea227e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.5", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.8" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-01-19T07:07:27+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:15+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-14T13:18:12+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T10:55:06+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-04-11T05:39:26+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-09-24T13:22:09+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-07-19T07:19:23+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:05:40+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:10:45+00:00" + }, + { + "name": "sebastian/version", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-07T11:34:05+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2023-11-20T00:12:19+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=8.2" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/config/sets/level/up-to-wp-0.71.php b/config/sets/level/up-to-wp-0.71.php new file mode 100644 index 0000000..e7674ab --- /dev/null +++ b/config/sets/level/up-to-wp-0.71.php @@ -0,0 +1,8 @@ +sets([WordPressSetList::WP_0_71]); +}; diff --git a/config/sets/level/up-to-wp-1.0.php b/config/sets/level/up-to-wp-1.0.php new file mode 100644 index 0000000..d1d91fc --- /dev/null +++ b/config/sets/level/up-to-wp-1.0.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_1_0, WordPressLevelSetList::UP_TO_WP_0_71]); +}; diff --git a/config/sets/level/up-to-wp-1.2.php b/config/sets/level/up-to-wp-1.2.php new file mode 100644 index 0000000..b4bbd9f --- /dev/null +++ b/config/sets/level/up-to-wp-1.2.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_1_2, WordPressLevelSetList::UP_TO_WP_1_0]); +}; diff --git a/config/sets/level/up-to-wp-1.5.php b/config/sets/level/up-to-wp-1.5.php new file mode 100644 index 0000000..c2a90c5 --- /dev/null +++ b/config/sets/level/up-to-wp-1.5.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_1_5, WordPressLevelSetList::UP_TO_WP_1_2]); +}; diff --git a/config/sets/level/up-to-wp-2.0.php b/config/sets/level/up-to-wp-2.0.php new file mode 100644 index 0000000..aa50832 --- /dev/null +++ b/config/sets/level/up-to-wp-2.0.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_0, WordPressLevelSetList::UP_TO_WP_1_5]); +}; diff --git a/config/sets/level/up-to-wp-2.1.php b/config/sets/level/up-to-wp-2.1.php new file mode 100644 index 0000000..2b01e72 --- /dev/null +++ b/config/sets/level/up-to-wp-2.1.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_1, WordPressLevelSetList::UP_TO_WP_2_0]); +}; diff --git a/config/sets/level/up-to-wp-2.2.php b/config/sets/level/up-to-wp-2.2.php new file mode 100644 index 0000000..4f61568 --- /dev/null +++ b/config/sets/level/up-to-wp-2.2.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_2, WordPressLevelSetList::UP_TO_WP_2_1]); +}; diff --git a/config/sets/level/up-to-wp-2.3.php b/config/sets/level/up-to-wp-2.3.php new file mode 100644 index 0000000..16c4426 --- /dev/null +++ b/config/sets/level/up-to-wp-2.3.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_3, WordPressLevelSetList::UP_TO_WP_2_2]); +}; diff --git a/config/sets/level/up-to-wp-2.5.php b/config/sets/level/up-to-wp-2.5.php new file mode 100644 index 0000000..5faff11 --- /dev/null +++ b/config/sets/level/up-to-wp-2.5.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_5, WordPressLevelSetList::UP_TO_WP_2_3]); +}; diff --git a/config/sets/level/up-to-wp-2.6.php b/config/sets/level/up-to-wp-2.6.php new file mode 100644 index 0000000..374bbc5 --- /dev/null +++ b/config/sets/level/up-to-wp-2.6.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_6, WordPressLevelSetList::UP_TO_WP_2_5]); +}; diff --git a/config/sets/level/up-to-wp-2.7.php b/config/sets/level/up-to-wp-2.7.php new file mode 100644 index 0000000..ef1c3c1 --- /dev/null +++ b/config/sets/level/up-to-wp-2.7.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_7, WordPressLevelSetList::UP_TO_WP_2_6]); +}; diff --git a/config/sets/level/up-to-wp-2.8.php b/config/sets/level/up-to-wp-2.8.php new file mode 100644 index 0000000..a8404da --- /dev/null +++ b/config/sets/level/up-to-wp-2.8.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_8, WordPressLevelSetList::UP_TO_WP_2_7]); +}; diff --git a/config/sets/level/up-to-wp-2.9.php b/config/sets/level/up-to-wp-2.9.php new file mode 100644 index 0000000..ae3f262 --- /dev/null +++ b/config/sets/level/up-to-wp-2.9.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_2_9, WordPressLevelSetList::UP_TO_WP_2_8]); +}; diff --git a/config/sets/level/up-to-wp-3.0.php b/config/sets/level/up-to-wp-3.0.php new file mode 100644 index 0000000..dac100b --- /dev/null +++ b/config/sets/level/up-to-wp-3.0.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_0, WordPressLevelSetList::UP_TO_WP_2_9]); +}; diff --git a/config/sets/level/up-to-wp-3.1.php b/config/sets/level/up-to-wp-3.1.php new file mode 100644 index 0000000..bd2b259 --- /dev/null +++ b/config/sets/level/up-to-wp-3.1.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_1, WordPressLevelSetList::UP_TO_WP_3_0]); +}; diff --git a/config/sets/level/up-to-wp-3.2.php b/config/sets/level/up-to-wp-3.2.php new file mode 100644 index 0000000..43cdf90 --- /dev/null +++ b/config/sets/level/up-to-wp-3.2.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_2, WordPressLevelSetList::UP_TO_WP_3_1]); +}; diff --git a/config/sets/level/up-to-wp-3.3.php b/config/sets/level/up-to-wp-3.3.php new file mode 100644 index 0000000..216b0af --- /dev/null +++ b/config/sets/level/up-to-wp-3.3.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_3, WordPressLevelSetList::UP_TO_WP_3_2]); +}; diff --git a/config/sets/level/up-to-wp-3.4.php b/config/sets/level/up-to-wp-3.4.php new file mode 100644 index 0000000..e79e0c3 --- /dev/null +++ b/config/sets/level/up-to-wp-3.4.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_4, WordPressLevelSetList::UP_TO_WP_3_3]); +}; diff --git a/config/sets/level/up-to-wp-3.5.php b/config/sets/level/up-to-wp-3.5.php new file mode 100644 index 0000000..d6f4e8d --- /dev/null +++ b/config/sets/level/up-to-wp-3.5.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_5, WordPressLevelSetList::UP_TO_WP_3_4]); +}; diff --git a/config/sets/level/up-to-wp-3.6.php b/config/sets/level/up-to-wp-3.6.php new file mode 100644 index 0000000..1df3135 --- /dev/null +++ b/config/sets/level/up-to-wp-3.6.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_6, WordPressLevelSetList::UP_TO_WP_3_5]); +}; diff --git a/config/sets/level/up-to-wp-3.7.php b/config/sets/level/up-to-wp-3.7.php new file mode 100644 index 0000000..71af98f --- /dev/null +++ b/config/sets/level/up-to-wp-3.7.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_7, WordPressLevelSetList::UP_TO_WP_3_6]); +}; diff --git a/config/sets/level/up-to-wp-3.8.php b/config/sets/level/up-to-wp-3.8.php new file mode 100644 index 0000000..c778174 --- /dev/null +++ b/config/sets/level/up-to-wp-3.8.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_8, WordPressLevelSetList::UP_TO_WP_3_7]); +}; diff --git a/config/sets/level/up-to-wp-3.9.php b/config/sets/level/up-to-wp-3.9.php new file mode 100644 index 0000000..2fc21a3 --- /dev/null +++ b/config/sets/level/up-to-wp-3.9.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_3_9, WordPressLevelSetList::UP_TO_WP_3_8]); +}; diff --git a/config/sets/level/up-to-wp-4.0.php b/config/sets/level/up-to-wp-4.0.php new file mode 100644 index 0000000..63eca3e --- /dev/null +++ b/config/sets/level/up-to-wp-4.0.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_0, WordPressLevelSetList::UP_TO_WP_3_9]); +}; diff --git a/config/sets/level/up-to-wp-4.1.php b/config/sets/level/up-to-wp-4.1.php new file mode 100644 index 0000000..bd20e4d --- /dev/null +++ b/config/sets/level/up-to-wp-4.1.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_1, WordPressLevelSetList::UP_TO_WP_4_0]); +}; diff --git a/config/sets/level/up-to-wp-4.2.php b/config/sets/level/up-to-wp-4.2.php new file mode 100644 index 0000000..43ee088 --- /dev/null +++ b/config/sets/level/up-to-wp-4.2.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_2, WordPressLevelSetList::UP_TO_WP_4_1]); +}; diff --git a/config/sets/level/up-to-wp-4.3.php b/config/sets/level/up-to-wp-4.3.php new file mode 100644 index 0000000..1c394a9 --- /dev/null +++ b/config/sets/level/up-to-wp-4.3.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_3, WordPressLevelSetList::UP_TO_WP_4_2]); +}; diff --git a/config/sets/level/up-to-wp-4.4.php b/config/sets/level/up-to-wp-4.4.php new file mode 100644 index 0000000..a97dc27 --- /dev/null +++ b/config/sets/level/up-to-wp-4.4.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_4, WordPressLevelSetList::UP_TO_WP_4_3]); +}; diff --git a/config/sets/level/up-to-wp-4.5.php b/config/sets/level/up-to-wp-4.5.php new file mode 100644 index 0000000..e4eacf8 --- /dev/null +++ b/config/sets/level/up-to-wp-4.5.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_5, WordPressLevelSetList::UP_TO_WP_4_4]); +}; diff --git a/config/sets/level/up-to-wp-4.6.php b/config/sets/level/up-to-wp-4.6.php new file mode 100644 index 0000000..c27c476 --- /dev/null +++ b/config/sets/level/up-to-wp-4.6.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_6, WordPressLevelSetList::UP_TO_WP_4_5]); +}; diff --git a/config/sets/level/up-to-wp-4.7.php b/config/sets/level/up-to-wp-4.7.php new file mode 100644 index 0000000..390fe05 --- /dev/null +++ b/config/sets/level/up-to-wp-4.7.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_7, WordPressLevelSetList::UP_TO_WP_4_6]); +}; diff --git a/config/sets/level/up-to-wp-4.8.php b/config/sets/level/up-to-wp-4.8.php new file mode 100644 index 0000000..5abd0e4 --- /dev/null +++ b/config/sets/level/up-to-wp-4.8.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_8, WordPressLevelSetList::UP_TO_WP_4_7]); +}; diff --git a/config/sets/level/up-to-wp-4.9.php b/config/sets/level/up-to-wp-4.9.php new file mode 100644 index 0000000..967c946 --- /dev/null +++ b/config/sets/level/up-to-wp-4.9.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_4_9, WordPressLevelSetList::UP_TO_WP_4_8]); +}; diff --git a/config/sets/level/up-to-wp-5.0.php b/config/sets/level/up-to-wp-5.0.php new file mode 100644 index 0000000..2cf3685 --- /dev/null +++ b/config/sets/level/up-to-wp-5.0.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_0, WordPressLevelSetList::UP_TO_WP_4_9]); +}; diff --git a/config/sets/level/up-to-wp-5.1.php b/config/sets/level/up-to-wp-5.1.php new file mode 100644 index 0000000..e8ab417 --- /dev/null +++ b/config/sets/level/up-to-wp-5.1.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_1, WordPressLevelSetList::UP_TO_WP_5_0]); +}; diff --git a/config/sets/level/up-to-wp-5.2.php b/config/sets/level/up-to-wp-5.2.php new file mode 100644 index 0000000..e221ddf --- /dev/null +++ b/config/sets/level/up-to-wp-5.2.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_2, WordPressLevelSetList::UP_TO_WP_5_1]); +}; diff --git a/config/sets/level/up-to-wp-5.3.php b/config/sets/level/up-to-wp-5.3.php new file mode 100644 index 0000000..947c3ae --- /dev/null +++ b/config/sets/level/up-to-wp-5.3.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_3, WordPressLevelSetList::UP_TO_WP_5_2]); +}; diff --git a/config/sets/level/up-to-wp-5.4.php b/config/sets/level/up-to-wp-5.4.php new file mode 100644 index 0000000..7b3d7da --- /dev/null +++ b/config/sets/level/up-to-wp-5.4.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_4, WordPressLevelSetList::UP_TO_WP_5_3]); +}; diff --git a/config/sets/level/up-to-wp-5.5.php b/config/sets/level/up-to-wp-5.5.php new file mode 100644 index 0000000..0b3c793 --- /dev/null +++ b/config/sets/level/up-to-wp-5.5.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_5, WordPressLevelSetList::UP_TO_WP_5_4]); +}; diff --git a/config/sets/level/up-to-wp-5.6.php b/config/sets/level/up-to-wp-5.6.php new file mode 100644 index 0000000..49c0701 --- /dev/null +++ b/config/sets/level/up-to-wp-5.6.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_6, WordPressLevelSetList::UP_TO_WP_5_5]); +}; diff --git a/config/sets/level/up-to-wp-5.7.php b/config/sets/level/up-to-wp-5.7.php new file mode 100644 index 0000000..a7aa126 --- /dev/null +++ b/config/sets/level/up-to-wp-5.7.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_7, WordPressLevelSetList::UP_TO_WP_5_6]); +}; diff --git a/config/sets/level/up-to-wp-5.8.php b/config/sets/level/up-to-wp-5.8.php new file mode 100644 index 0000000..951300e --- /dev/null +++ b/config/sets/level/up-to-wp-5.8.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_8, WordPressLevelSetList::UP_TO_WP_5_7]); +}; diff --git a/config/sets/level/up-to-wp-5.9.php b/config/sets/level/up-to-wp-5.9.php new file mode 100644 index 0000000..e6edae5 --- /dev/null +++ b/config/sets/level/up-to-wp-5.9.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_5_9, WordPressLevelSetList::UP_TO_WP_5_8]); +}; diff --git a/config/sets/level/up-to-wp-6.0.php b/config/sets/level/up-to-wp-6.0.php new file mode 100644 index 0000000..19fa072 --- /dev/null +++ b/config/sets/level/up-to-wp-6.0.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_6_0, WordPressLevelSetList::UP_TO_WP_5_9]); +}; diff --git a/config/sets/level/up-to-wp-6.1.php b/config/sets/level/up-to-wp-6.1.php new file mode 100644 index 0000000..a558989 --- /dev/null +++ b/config/sets/level/up-to-wp-6.1.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_6_1, WordPressLevelSetList::UP_TO_WP_6_0]); +}; diff --git a/config/sets/level/up-to-wp-6.2.php b/config/sets/level/up-to-wp-6.2.php new file mode 100644 index 0000000..4e49302 --- /dev/null +++ b/config/sets/level/up-to-wp-6.2.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_6_2, WordPressLevelSetList::UP_TO_WP_6_1]); +}; diff --git a/config/sets/level/up-to-wp-6.3.php b/config/sets/level/up-to-wp-6.3.php new file mode 100644 index 0000000..b197fcd --- /dev/null +++ b/config/sets/level/up-to-wp-6.3.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_6_3, WordPressLevelSetList::UP_TO_WP_6_2]); +}; diff --git a/config/sets/level/up-to-wp-6.4.php b/config/sets/level/up-to-wp-6.4.php new file mode 100644 index 0000000..8ed6d25 --- /dev/null +++ b/config/sets/level/up-to-wp-6.4.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_6_4, WordPressLevelSetList::UP_TO_WP_6_3]); +}; diff --git a/config/sets/wp-0.71.php b/config/sets/wp-0.71.php new file mode 100644 index 0000000..cbe9652 --- /dev/null +++ b/config/sets/wp-0.71.php @@ -0,0 +1,22 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('convert_chars', 1), + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - comments_link:1 + * + * FUNCTIONS + * - the_category_head + * - the_category_ID + */ +}; diff --git a/config/sets/wp-1.0.php b/config/sets/wp-1.0.php new file mode 100644 index 0000000..9fd6cbb --- /dev/null +++ b/config/sets/wp-1.0.php @@ -0,0 +1,5 @@ +ruleWithConfiguration(RenameFunctionRector::class, [ + 'permalink_link' => 'the_permalink', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - permalink_link + */ +}; diff --git a/config/sets/wp-1.5.php b/config/sets/wp-1.5.php new file mode 100644 index 0000000..62ba7c0 --- /dev/null +++ b/config/sets/wp-1.5.php @@ -0,0 +1,26 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_action', 0, 'retreive_password', 'retrieve_password'), + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'rewrite_rules', 'mod_rewrite_rules'), + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - the_author:2 + * + * FILES + * - my-hacks.php + * + * FUNCTIONS + * - get_postdata + * - start_wp + */ +}; diff --git a/config/sets/wp-2.0.php b/config/sets/wp-2.0.php new file mode 100644 index 0000000..aa445cb --- /dev/null +++ b/config/sets/wp-2.0.php @@ -0,0 +1,30 @@ +ruleWithConfiguration(RenameFunctionRector::class, [ + 'create_user' => 'wp_create_user', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - wp_upload_bits:2 + * + * FUNCTIONS + * - next_post + * - previous_post + * - user_can_create_draft + * - user_can_create_post + * - user_can_delete_post + * - user_can_delete_post_comments + * - user_can_edit_post + * - user_can_edit_post_comments + * - user_can_edit_post_date + * - user_can_edit_user + * - user_can_set_post_date + */ +}; diff --git a/config/sets/wp-2.1.php b/config/sets/wp-2.1.php new file mode 100644 index 0000000..95b2832 --- /dev/null +++ b/config/sets/wp-2.1.php @@ -0,0 +1,74 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('get_the_author', 0), + new RemoveFuncCallArg('get_autotoggle', 0), + new RemoveFuncCallArg('wp_get_post_cats', 0), + new RemoveFuncCallArg('wp_set_post_cats', 0), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('get_autotoggle', 0, 0), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'links_popup_script', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'get_link' => 'get_bookmark', + 'get_settings' => 'get_option', + 'wp_get_post_cats' => 'wp_get_post_categories', + 'wp_set_post_cats' => 'wp_set_post_categories', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'get_autotoggle', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - the_author:1 + * - the_author_posts_link:1 + * + * FILES + * - wp-includes/registration-functions.php + * - wp-includes/rss-functions.php + * + * FILTERS + * - query_string + * + * FUNCTIONS + * - dropdown_cats + * - get_archives + * - get_author_link + * - get_linkcatname + * - get_linkobjects + * - get_linkobjectsbyname + * - get_linkrating + * - get_links + * - get_links_list + * - get_links_withrating + * - get_linksbyname + * - get_linksbyname_withrating + * - link_pages + * - list_authors + * - list_cats + * - tinymce_include + * - wp_get_links + * - wp_get_linksbyname + * - wp_list_cats + */ +}; diff --git a/config/sets/wp-2.2.php b/config/sets/wp-2.2.php new file mode 100644 index 0000000..ce72b42 --- /dev/null +++ b/config/sets/wp-2.2.php @@ -0,0 +1,16 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('permalink_single_rss', 0), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'permalink_single_rss' => 'the_permalink_rss', + ]); + + /* + * TODO: these are not handled currently + * + * ACTIONS + * - private_to_published + * + * ARGUMENTS + * - _future_post_hook:1 + * - add_option:3 + */ +}; diff --git a/config/sets/wp-2.5.php b/config/sets/wp-2.5.php new file mode 100644 index 0000000..cf44d4d --- /dev/null +++ b/config/sets/wp-2.5.php @@ -0,0 +1,48 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('trackback_rdf', 0), + new RemoveFuncCallArg('wp_login', 2), + new RemoveFuncCallArg('xfn_check', 2), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'documentation_link', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'comments_rss_link' => 'post_comments_feed_link', + 'gzip_compression' => '__return_false', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - the_attachment_link:3 + * - trackback_url:1 + * + * FILE + * - wp-admin/admin-functions.php + * - wp-admin/upgrade-functions.php + * + * FUNCTIONS + * - get_attachment_icon + * - get_attachment_icon_src + * - get_attachment_innerHTML + * - get_author_rss_link + * - get_category_rss_link + * - get_the_attachment_link + * - wp_clearcookie + * - wp_get_cookie_login + * - wp_login + * - wp_setcookie + */ +}; diff --git a/config/sets/wp-2.6.php b/config/sets/wp-2.6.php new file mode 100644 index 0000000..246e888 --- /dev/null +++ b/config/sets/wp-2.6.php @@ -0,0 +1,16 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('discover_pingback_server_uri', 1), + new RemoveFuncCallArg('wp_get_http_headers', 1), + new RemoveFuncCallArg('get_commentdata', 1), + new RemoveFuncCallArg('get_commentdata', 2), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('get_commentdata', 1, new PhpParser\Node\Expr\ConstFetch(new PhpParser\Node\Name('ARRAY_A'))), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'get_commentdata' => 'get_comment', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - load_plugin_textdomain:2 + * + * FUNCTIONS + * - get_commentdata + * + * METHODS + * - WP_Filesystem_Base::find_base_dir + * - WP_Filesystem_Base::get_base_dir + */ +}; diff --git a/config/sets/wp-2.8.php b/config/sets/wp-2.8.php new file mode 100644 index 0000000..5913bc0 --- /dev/null +++ b/config/sets/wp-2.8.php @@ -0,0 +1,102 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'tagsperpage', 'edit_tags_per_page'), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterPrependerRector::class, [ + new FunctionParameterPrepender('get_author_name', 'display_name'), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('get_the_author_aim', 0, 'aim'), + new FunctionParameterAdder('get_the_author_description', 0, 'description'), + new FunctionParameterAdder('get_the_author_email', 0, 'email'), + new FunctionParameterAdder('get_the_author_firstname', 0, 'first_name'), + new FunctionParameterAdder('get_the_author_icq', 0, 'icq'), + new FunctionParameterAdder('get_the_author_ID', 0, 'ID'), + new FunctionParameterAdder('get_the_author_lastname', 0, 'last_name'), + new FunctionParameterAdder('get_the_author_login', 0, 'login'), + new FunctionParameterAdder('get_the_author_msn', 0, 'msn'), + new FunctionParameterAdder('get_the_author_nickname', 0, 'nickname'), + new FunctionParameterAdder('get_the_author_url', 0, 'url'), + new FunctionParameterAdder('get_the_author_yim', 0, 'yim'), + new FunctionParameterAdder('the_author_aim', 0, 'aim'), + new FunctionParameterAdder('the_author_description', 0, 'description'), + new FunctionParameterAdder('the_author_email', 0, 'email'), + new FunctionParameterAdder('the_author_firstname', 0, 'first_name'), + new FunctionParameterAdder('the_author_icq', 0, 'icq'), + new FunctionParameterAdder('the_author_ID', 0, 'ID'), + new FunctionParameterAdder('the_author_lastname', 0, 'last_name'), + new FunctionParameterAdder('the_author_login', 0, 'login'), + new FunctionParameterAdder('the_author_msn', 0, 'msn'), + new FunctionParameterAdder('the_author_nickname', 0, 'nickname'), + new FunctionParameterAdder('the_author_url', 0, 'url'), + new FunctionParameterAdder('the_author_yim', 0, 'yim'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('safecss_filter_attr', 1), + new RemoveFuncCallArg('wp_get_sidebars_widgets', 0), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + '__ngettext' => '_n', + '__ngettext_noop' => '_n_noop', + 'attribute_escape' => 'esc_attr', + 'get_author_name' => 'get_the_author_meta', + 'get_catname' => 'get_cat_name', + 'get_the_author_aim' => 'get_the_author_meta', + 'get_the_author_description' => 'get_the_author_meta', + 'get_the_author_email' => 'get_the_author_meta', + 'get_the_author_firstname' => 'get_the_author_meta', + 'get_the_author_icq' => 'get_the_author_meta', + 'get_the_author_ID' => 'get_the_author_meta', + 'get_the_author_lastname' => 'get_the_author_meta', + 'get_the_author_login' => 'get_the_author_meta', + 'get_the_author_msn' => 'get_the_author_meta', + 'get_the_author_nickname' => 'get_the_author_meta', + 'get_the_author_url' => 'get_the_author_meta', + 'get_the_author_yim' => 'get_the_author_meta', + 'js_escape' => 'esc_js', + 'the_author_aim' => 'the_author_meta', + 'the_author_description' => 'the_author_meta', + 'the_author_email' => 'the_author_meta', + 'the_author_firstname' => 'the_author_meta', + 'the_author_icq' => 'the_author_meta', + 'the_author_ID' => 'the_author_meta', + 'the_author_lastname' => 'the_author_meta', + 'the_author_login' => 'the_author_meta', + 'the_author_msn' => 'the_author_meta', + 'the_author_nickname' => 'the_author_meta', + 'the_author_url' => 'the_author_meta', + 'the_author_yim' => 'the_author_meta', + 'unregister_sidebar_widget' => 'wp_unregister_sidebar_widget', + 'unregister_widget_control' => 'wp_unregister_widget_control', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - get_category_children + * - register_sidebar_widget + * - register_widget_control + * - wp_specialchars + * + * METHODS + * - wp_xmlrpc_server::login_pass_ok + */ +}; diff --git a/config/sets/wp-2.9.php b/config/sets/wp-2.9.php new file mode 100644 index 0000000..c6375be --- /dev/null +++ b/config/sets/wp-2.9.php @@ -0,0 +1,17 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_settings_field', 3, 'misc', 'general'), + new ReplaceFuncCallArgumentDefaultValue('add_settings_section', 3, 'misc', 'general'), + new ReplaceFuncCallArgumentDefaultValue('register_setting', 0, 'misc', 'general'), + new ReplaceFuncCallArgumentDefaultValue('unregister_setting', 0, 'misc', 'general'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('get_blog_list', 2), + new RemoveFuncCallArg('get_user_option', 2), + new RemoveFuncCallArg('is_email', 1), + new RemoveFuncCallArg('newblog_notify_siteadmin', 1), + new RemoveFuncCallArg('redirect_this_site', 0), + new RemoveFuncCallArg('update_posts_count', 0), + new RemoveFuncCallArg('update_user_status', 3), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'clear_global_post_cache', + 'codepress_footer_js', + 'codepress_get_lang', + 'deactivate_sitewide_plugin', + 'use_codepress', + 'wpmu_menu', + ]); + + $rectorConfig->ruleWithConfiguration(ParameterPrependerRector::class, [ + new FunctionParameterPrepender('get_user_details', 'login'), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'activate_sitewide_plugin' => '__return_false', + 'add_option_update_handler' => 'register_setting', + 'generate_random_password' => 'wp_generate_password', + 'get_alloptions' => 'wp_load_alloptions', + 'get_user_details' => 'get_user_by', + 'get_usernumposts' => 'count_user_posts', + 'is_main_blog' => 'is_main_site', + 'is_taxonomy' => 'taxonomy_exists', + 'is_term' => 'term_exists', + 'is_wpmu_sitewide_plugin' => 'is_network_only_plugin', + 'remove_option_update_handler' => 'unregister_setting', + 'set_current_user' => 'wp_set_current_user', + 'validate_email' => 'is_email', + 'wp_shrink_dimensions' => 'wp_constrain_dimensions', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'mu_options', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - get_delete_post_link:2 + * - get_last_updated:1 + * + * FUNCTIONS + * - automatic_feed_links + * - clean_url + * - delete_usermeta + * - funky_javascript_callback + * - funky_javascript_fix + * - get_blog_list + * - get_most_active_blogs + * - get_profile + * - get_usermeta + * - graceful_fail + * - install_blog_defaults + * - is_site_admin + * - update_usermeta + * - wp_dropdown_cats + * - wpmu_checkAvailableSpace + */ +}; diff --git a/config/sets/wp-3.1.php b/config/sets/wp-3.1.php new file mode 100644 index 0000000..ad74d79 --- /dev/null +++ b/config/sets/wp-3.1.php @@ -0,0 +1,50 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'tag_rewrite_rules', 'post_tag_rewrite_rules'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('update_blog_option', 3), + new RemoveFuncCallArg('update_blog_status', 3), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'update_category_cache' => '__return_true', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - register_uninstall_hook:2 + * - wp_get_recent_posts:1 + * + * CLASSES + * - WP_User_Search + * + * FILES + * - wp-includes/registration.php + * + * FUNCTIONS + * - get_author_user_ids + * - get_dashboard_blog + * - get_editable_authors + * - get_editable_user_ids + * - get_nonauthor_user_ids + * - get_others_drafts + * - get_others_pending + * - get_others_unpublished_posts + * - get_users_of_blog + * - install_themes_feature_list + * - is_plugin_page + */ +}; diff --git a/config/sets/wp-3.2.php b/config/sets/wp-3.2.php new file mode 100644 index 0000000..000c168 --- /dev/null +++ b/config/sets/wp-3.2.php @@ -0,0 +1,24 @@ +ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'favorite_actions', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'wp_clone' => 'clone', + 'wp_dashboard_quick_press_output' => 'wp_dashboard_quick_press', + 'wp_timezone_supported' => '__return_true', + ]); + + /* + * TODO: these are not handled currently + * + * FILTERS + * - pub_priv_sql_capability + */ +}; diff --git a/config/sets/wp-3.3.php b/config/sets/wp-3.3.php new file mode 100644 index 0000000..fa07335 --- /dev/null +++ b/config/sets/wp-3.3.php @@ -0,0 +1,88 @@ +ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('start_post_rel_link', 3, true), + new FunctionParameterAdder('type_url_form_audio', 0, 'audio'), + new FunctionParameterAdder('type_url_form_file', 0, 'file'), + new FunctionParameterAdder('type_url_form_image', 0, 'image'), + new FunctionParameterAdder('type_url_form_video', 0, 'video'), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterPrependerRector::class, [ + new FunctionParameterPrepender('get_user_by_email', 'email'), + new FunctionParameterPrepender('get_userdatabylogin', 'login'), + new FunctionParameterPrepender('is_blog_user', new PhpParser\Node\Expr\FuncCall(new PhpParser\Node\Name('get_current_user_id'))), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'wp_preload_dialogs', + 'wp_print_editor_js', + 'wp_quicktags', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'get_user_by_email' => 'get_user_by', + 'get_userdatabylogin' => 'get_user_by', + 'is_blog_user' => 'is_user_member_of_blog', + 'media_upload_audio' => 'wp_media_upload_handler', + 'media_upload_file' => 'wp_media_upload_handler', + 'media_upload_image' => 'wp_media_upload_handler', + 'media_upload_video' => 'wp_media_upload_handler', + 'start_post_rel_link' => 'get_boundary_post_rel_link', + 'type_url_form_audio' => 'wp_media_insert_url_form', + 'type_url_form_file' => 'wp_media_insert_url_form', + 'type_url_form_image' => 'wp_media_insert_url_form', + 'type_url_form_video' => 'wp_media_insert_url_form', + ]); + + $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ + new MethodCallRename('WP_Scripts', 'print_scripts_l10n', 'print_extra_script'), + ]); + + $rectorConfig->rule(TheEditorRector::class); + + /* + * TODO: these are not handled currently + * + * FILTERS + * - contextual_help + * - contextual_help_list + * - default_contextual_help + * + * FUNCTIONS + * - add_contextual_help + * - get_boundary_post_rel_link + * - get_index_rel_link + * - get_parent_post_rel_link + * - get_user_metavalues + * - index_rel_link + * - parent_post_rel_link + * - sanitize_user_object + * - screen_layout + * - screen_meta + * - screen_options + * - the_editor - CUSTOM RULE + * - wp_admin_bar_dashboard_view_site_menu + * - wp_tiny_mce + * - wpmu_admin_do_redirect + * - wpmu_admin_redirect_add_updated_param + * + * METHODS + * - WP_Admin_Bar::recursive_render + * + * PROPERTIES + * - WP_Admin_Bar::$menu + */ +}; diff --git a/config/sets/wp-3.4.php b/config/sets/wp-3.4.php new file mode 100644 index 0000000..c8f6f95 --- /dev/null +++ b/config/sets/wp-3.4.php @@ -0,0 +1,59 @@ +ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('remove_custom_background', 0, 'custom-background'), + new FunctionParameterAdder('remove_custom_image_header', 0, 'custom-header'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('debug_fopen', 0), + new RemoveFuncCallArg('debug_fopen', 1), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'clean_page_cache' => 'clean_post_cache', + 'current_theme_info' => 'wp_get_theme', + 'debug_fopen' => '__return_false', + 'remove_custom_background' => 'remove_theme_support', + 'remove_custom_image_header' => 'remove_theme_support', + 'update_page_cache' => 'update_post_cache', + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'debug_fclose', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - add_custom_background + * - add_custom_image_header + * - clean_pre + * - debug_fwrite + * - display_theme + * - get_allowed_themes + * - get_broken_themes + * - get_current_theme + * - get_site_allowed_themes + * - get_theme + * - get_theme_data + * - get_themes + * - logIO + * - wpmu_get_blog_allowedthemes + * - wp_explain_nonce + * + * PROPERTIES + * - WP_Scripts::$concat_version + * - WP_Styles::$concat_version + */ +}; diff --git a/config/sets/wp-3.5.php b/config/sets/wp-3.5.php new file mode 100644 index 0000000..9dfd1c2 --- /dev/null +++ b/config/sets/wp-3.5.php @@ -0,0 +1,104 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_settings_field', 3, 'privacy', 'reading'), + new ReplaceFuncCallArgumentDefaultValue('add_settings_section', 3, 'privacy', 'reading'), + new ReplaceFuncCallArgumentDefaultValue('register_setting', 0, 'privacy', 'reading'), + new ReplaceFuncCallArgumentDefaultValue('unregister_setting', 0, 'privacy', 'reading'), + ]); + + $rectorConfig->ruleWithConfiguration(FuncParameterAdderRector::class, [ + new FunctionParameterAdder('get_default_page_to_edit', 0, 'page'), + new FunctionParameterAdder('get_post_to_edit', 1, new PhpParser\Node\Expr\ConstFetch(new PhpParser\Node\Name('OBJECT'))), + new FunctionParameterAdder('get_post_to_edit', 2, 'edit'), + new FunctionParameterAdder('get_udims', 2, 128), + new FunctionParameterAdder('get_udims', 3, 96), + ]); + + $rectorConfig->ruleWithConfiguration(MethodParameterAdderRector::class, [ + new MethodParameterAdder('wpdb', 'supports_collation', 0, 'collation'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('switch_to_blog', 1), + new RemoveFuncCallArg('wp_create_thumbnail', 2), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + '_get_post_ancestors', + '_insert_into_post_button', + '_media_button', + '_save_post_hook', + 'ms_deprecated_blogs_file', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'wp_get_single_post' => 'get_post', + 'get_page' => 'get_post', + 'get_default_page_to_edit' => 'get_default_post_to_edit', + 'get_post_to_edit' => 'get_post', + 'get_udims' => 'wp_constrain_dimensions', + ]); + + $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ + new MethodCallRename('wpdb', 'supports_collation', 'has_cap'), + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'attachment_fields_to_edit' => 'Custom_Background', + 'filter_upload_tabs' => 'Custom_Background', + ]); + + /* + * TODO: these are not handled currently + * + * ARGUMENTS + * - image_edit_apply_changes:1 + * - wp_stream_image:1 + * + * FILTERS + * - image_edit_before_change + * - image_save_pre + * - media_buttons_context + * - wp_save_image_file + * + * FUNCTIONS + * - _flip_image_resource + * - _rotate_image_resource + * - gd_edit_image_support + * - image_resize + * - sticky_class + * - user_pass_ok + * - wp_cache_reset + * - wp_create_thumbnail + * - wp_load_image + * + * METHODS + * - Custom_Background::wp_set_background_image + * - wp_atom_server::__call + * - wp_atom_server::__callStatic + * - WP_Object_Cache::reset + * - wp_xmlrpc_server::blogger_getTemplate + * - wp_xmlrpc_server::blogger_setTemplate + * + * PROPERTIES + * - WP_Screen::$is_network + * - WP_Screen::$is_user + */ +}; diff --git a/config/sets/wp-3.6.php b/config/sets/wp-3.6.php new file mode 100644 index 0000000..a7220a4 --- /dev/null +++ b/config/sets/wp-3.6.php @@ -0,0 +1,32 @@ +ruleWithConfiguration(MethodCallToFuncCallRector::class, [ + new MethodCallToFuncCall('wpdb', '_weak_escape', 'esc_sql'), + new MethodCallToFuncCall('wpdb', 'escape', 'esc_sql'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'wp_nav_menu_locations_meta_box', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'wp_convert_bytes_to_hr' => 'size_format', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - get_user_id_from_string + * + * - wpdb::_weak_escape + * - wpdb::escape + */ +}; diff --git a/config/sets/wp-3.7.php b/config/sets/wp-3.7.php new file mode 100644 index 0000000..6e79482 --- /dev/null +++ b/config/sets/wp-3.7.php @@ -0,0 +1,27 @@ +ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'the_attachment_links', + ]); + + /* + * TODO: these are not handled currently + * + * ACTIONS + * - dbx_post_advanced + * + * CLASSES + * - WP_HTTP_Fsockopen + * + * FUNCTIONS + * - _search_terms_tidy + * - get_blogaddress_by_domain + * - wp_update_core + * - wp_update_plugin + * - wp_update_theme + */ +}; diff --git a/config/sets/wp-3.8.php b/config/sets/wp-3.8.php new file mode 100644 index 0000000..f8ab20f --- /dev/null +++ b/config/sets/wp-3.8.php @@ -0,0 +1,32 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('wp_notify_postauthor', 1), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'wp_dashboard_incoming_links', + 'wp_dashboard_incoming_links_control', + 'wp_dashboard_incoming_links_output', + 'wp_dashboard_plugins', + 'wp_dashboard_primary_control', + 'wp_dashboard_recent_comments_control', + 'wp_dashboard_secondary', + 'wp_dashboard_secondary_control', + 'wp_dashboard_secondary_output', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - get_screen_icon + * - screen_icon + */ +}; diff --git a/config/sets/wp-3.9.php b/config/sets/wp-3.9.php new file mode 100644 index 0000000..0010ace --- /dev/null +++ b/config/sets/wp-3.9.php @@ -0,0 +1,25 @@ +ruleWithConfiguration(RemoveFuncCallRector::class, [ + '_relocate_children', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'default_topic_count_text', + 'format_to_post', + 'get_current_site_name', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - rich_edit_exists + * - wpmu_current_site + */ +}; diff --git a/config/sets/wp-4.0.php b/config/sets/wp-4.0.php new file mode 100644 index 0000000..9058ff3 --- /dev/null +++ b/config/sets/wp-4.0.php @@ -0,0 +1,45 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('define', 0, 'FORCE_SSL_LOGIN', 'FORCE_SSL_ADMIN'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('delete_plugins', 1), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('get_all_category_ids', 0, [ + 'taxonomy' => 'category', + 'fields' => 'ids', + 'get' => 'all', + ]), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'get_all_category_ids' => 'get_terms', + ]); + + $rectorConfig->ruleWithConfiguration(RenameConstantRector::class, [ + 'FORCE_SSL_LOGIN' => 'FORCE_SSL_ADMIN', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - like_escape + * - url_is_accessable_via_ssl + */ +}; diff --git a/config/sets/wp-4.1.php b/config/sets/wp-4.1.php new file mode 100644 index 0000000..421c58b --- /dev/null +++ b/config/sets/wp-4.1.php @@ -0,0 +1,13 @@ +ruleWithConfiguration(RemoveMethodCallRector::class, [ + 'add_tab' => 'WP_Customize_Image_Control', + 'prepare_control' => 'WP_Customize_Image_Control', + 'print_tab_image' => 'WP_Customize_Image_Control', + 'remove_tab' => 'WP_Customize_Image_Control', + ]); +}; diff --git a/config/sets/wp-4.2.php b/config/sets/wp-4.2.php new file mode 100644 index 0000000..67187f3 --- /dev/null +++ b/config/sets/wp-4.2.php @@ -0,0 +1,19 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('iframe_header', 1), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveMethodCallRector::class, [ + 'prepreview_added_sidebars_widgets' => 'WP_Customize_Widgets', + 'prepreview_added_widget_instance' => 'WP_Customize_Widgets', + 'remove_prepreview_filters' => 'WP_Customize_Widgets', + 'setup_widget_addition_previews' => 'WP_Customize_Widgets', + ]); +}; diff --git a/config/sets/wp-4.3.php b/config/sets/wp-4.3.php new file mode 100644 index 0000000..e8ec126 --- /dev/null +++ b/config/sets/wp-4.3.php @@ -0,0 +1,50 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'htmledit_pre', 'format_for_editor'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'preview_theme', + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('preview_theme_ob_filter_callback', 0), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + '_preview_theme_stylesheet_filter' => '__return_empty_string', + '_preview_theme_template_filter' => '__return_empty_string', + 'preview_theme_ob_filter_callback' => '__return_empty_string', + 'wp_htmledit_pre' => 'format_for_editor', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'preview_theme_ob_filter', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - wp_ajax_wp_fullscreen_save_post + * - wp_new_user_notification + * - wp_richedit_pre + * + * FILTERS + * - richedit_pre + * + * METHODS + * - _WP_Editors::wp_fullscreen_html + */ +}; diff --git a/config/sets/wp-4.4.php b/config/sets/wp-4.4.php new file mode 100644 index 0000000..0850c70 --- /dev/null +++ b/config/sets/wp-4.4.php @@ -0,0 +1,33 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('get_site_option', 2), + new RemoveFuncCallArg('get_wp_title_rss', 0), + new RemoveFuncCallArg('wp_title_rss', 0), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveMethodCallRector::class, [ + 'flush_widget_cache' => 'WP_Widget_Recent_Comments', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'force_ssl_login' => 'force_ssl_admin', + 'post_permalink' => 'get_permalink', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - create_empty_blog + * - get_admin_users_for_domain + * - wp_get_http + */ +}; diff --git a/config/sets/wp-4.5.php b/config/sets/wp-4.5.php new file mode 100644 index 0000000..c876f15 --- /dev/null +++ b/config/sets/wp-4.5.php @@ -0,0 +1,54 @@ +ruleWithConfiguration(MethodCallToFuncCallRector::class, [ + new MethodCallToFuncCall('WP_Query', 'is_comments_popup', '__return_false'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('_wp_post_revision_fields', 1), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'comments_popup_script', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'get_comments_popup_template' => '__return_empty_string', + 'get_currentuserinfo' => 'wp_get_current_user', + 'is_comments_popup' => '__return_false', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'lazyload_comment_meta' => 'WP_Query', + 'lazyload_term_meta' => 'WP_Query', + ]); + + /* + * TODO: these are not handled currently + * + * FILES + * - wp-includes/embed-template.php + * + * FUNCTIONS + * - add_object_page + * - add_utility_page + * - get_terms + * - popuplinks + * + * METHODS + * - WP_Customize_Nav_Menus_Panel::wp_nav_menu_manage_columns + * + * PROPERTIES + * - WP_Dependencies::$group + */ +}; diff --git a/config/sets/wp-4.6.php b/config/sets/wp-4.6.php new file mode 100644 index 0000000..06c40e0 --- /dev/null +++ b/config/sets/wp-4.6.php @@ -0,0 +1,29 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('install_search_form', 0), + new RemoveFuncCallArg('wp_embed_handler_googlevideo', 0), + new RemoveFuncCallArg('wp_embed_handler_googlevideo', 1), + new RemoveFuncCallArg('wp_embed_handler_googlevideo', 2), + new RemoveFuncCallArg('wp_embed_handler_googlevideo', 3), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'wp_embed_handler_googlevideo' => '__return_empty_string', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - post_form_autocomplete_off + * - register_meta + * - wp_get_sites + */ +}; diff --git a/config/sets/wp-4.7.php b/config/sets/wp-4.7.php new file mode 100644 index 0000000..425cf90 --- /dev/null +++ b/config/sets/wp-4.7.php @@ -0,0 +1,75 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'blog_details', 'site_details'), + ]); + + $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('get_paged_template', 0, 'paged'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('unregister_setting', 2), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveMethodCallRector::class, [ + 'customize_preview_base' => 'WP_Customize_Manager', + 'customize_preview_html5' => 'WP_Customize_Manager', + 'customize_preview_override_404_status' => 'WP_Customize_Manager', + 'customize_preview_signature' => 'WP_Customize_Manager', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'get_paged_template' => 'get_query_template', + ]); + + $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ + new MethodCallRename('WP_Roles', 'reinit', 'for_site'), + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'remove_preview_signature' => 'WP_Customize_Manager', + ]); + + $rectorConfig->rule(WpKsesJsEntitiesRector::class); + + /* + * TODO: these are not handled currently + * + * FILES + * - wp-admin/includes/class-wp-upgrader-skins.php + * - wp-includes/class-feed.php + * - wp-includes/locale.php + * - wp-includes/session.php + * + * FILTERS + * - rest_enabled + * + * FUNCTIONS + * - _sort_nav_menu_items + * - _usort_terms_by_ID + * - _usort_terms_by_name + * - wp_get_network + * + * METHODS + * - WP_Customize_Manager::_cmp_priority + * - WP_Customize_Manager::wp_die_handler + * - WP_Customize_Manager::wp_redirect_status + * - WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby + */ +}; diff --git a/config/sets/wp-4.8.php b/config/sets/wp-4.8.php new file mode 100644 index 0000000..cd38b2b --- /dev/null +++ b/config/sets/wp-4.8.php @@ -0,0 +1,18 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('get_category_parents', 4), + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - wp_dashboard_plugins_output + */ +}; diff --git a/config/sets/wp-4.9.php b/config/sets/wp-4.9.php new file mode 100644 index 0000000..268ad85 --- /dev/null +++ b/config/sets/wp-4.9.php @@ -0,0 +1,54 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('term_description', 1), + ]); + + $rectorConfig->ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_action', 0, 'refresh_blog_details', 'clean_site_cache'), + ]); + + $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ + new MethodCallRename('WP_User', 'for_blog', 'for_site'), + ]); + + /* + * TODO: these are not handled currently + * + * CLASSES + * - WP_Customize_New_Menu_Control + * - WP_Customize_New_Menu_Section + * + * FILES + * - wp-includes/customize/class-wp-customize-nav-menu-name-control.php + * - wp-includes/customize/class-wp-customize-new-menu-control.php + * - wp-includes/customize/class-wp-customize-new-menu-section.php + * + * FILTERS + * - auth_{$object_type}_{$object_subtype}_meta_{$meta_key} + * - shortcut_link + * + * FUNCTIONS + * - get_shortcut_link + * - is_user_option_local + * - options_permalink_add_js + * - wp_ajax_press_this_add_category + * - wp_ajax_press_this_save_post + * + * METHODS + * - WP_Community_Events::maybe_log_events_response + * - WP_Customize_New_Menu_Control::render_content + * - WP_Customize_New_Menu_Section::render + * - WP_Roles::_init + * - WP_User::_init_caps + */ +}; diff --git a/config/sets/wp-5.0.php b/config/sets/wp-5.0.php new file mode 100644 index 0000000..9fd6cbb --- /dev/null +++ b/config/sets/wp-5.0.php @@ -0,0 +1,5 @@ +ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'upgrade_500', + ]); + + /* + * TODO: these are not handled currently + * + * ACTIONS + * - delete_blog + * - deleted_blog + * - wpmu_new_blog + * + * FUNCTIONS + * - insert_blog + * - install_blog + * + * METHODS + * - WP_Http::_dispatch_request + */ +}; diff --git a/config/sets/wp-5.2.php b/config/sets/wp-5.2.php new file mode 100644 index 0000000..ac48fc6 --- /dev/null +++ b/config/sets/wp-5.2.php @@ -0,0 +1,11 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'login_headertitle', 'login_headertext'), + ]); +}; diff --git a/config/sets/wp-5.3.php b/config/sets/wp-5.3.php new file mode 100644 index 0000000..951f363 --- /dev/null +++ b/config/sets/wp-5.3.php @@ -0,0 +1,60 @@ +ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('wp_rel_nofollow_callback', 1, 'nofollow'), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'wp_rel_nofollow_callback' => 'wp_rel_callback', + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + '_wp_privacy_requests_screen_options', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + '_wp_json_prepare_data', + ]); + + /* + * TODO: these are not handled currently + * + * CLASSES + * - WP_Privacy_Data_Export_Requests_Table + * - WP_Privacy_Data_Removal_Requests_Table + * + * FILES + * - wp-admin/custom-background.php + * - wp-admin/custom-header.php + * - wp-includes/class-oembed.php + * - wp-includes/date.php + * - wp-includes/spl-autoload-compat.php + * + * FUNCTIONS + * - update_user_status + * + * METHODS + * - Services_JSON::_encode + * - Services_JSON::decode + * - Services_JSON::encode + * - Services_JSON::encodeUnsafe + * - Services_JSON::isError + * - Services_JSON::name_value + * - Services_JSON::reduce_string + * - Services_JSON::Services_JSON + * - Services_JSON::strlen8 + * - Services_JSON::substr8 + * - Services_JSON::utf162utf8 + * - Services_JSON::utf82utf16 + * - Services_JSON_Error::Services_JSON_Error + * + */ +}; diff --git a/config/sets/wp-5.4.php b/config/sets/wp-5.4.php new file mode 100644 index 0000000..0c07533 --- /dev/null +++ b/config/sets/wp-5.4.php @@ -0,0 +1,25 @@ +ruleWithConfiguration(RenameFunctionRector::class, [ + 'wp_get_user_request_data' => 'wp_get_user_request', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - wp_favicon_request + * + * METHODS + * - POMO_CachedFileReader::POMO_CachedFileReader + * - POMO_CachedIntFileReader::POMO_CachedIntFileReader + * - POMO_FileReader::POMO_FileReader + * - POMO_Reader::POMO_Reader + * - POMO_StringReader::POMO_StringReader + * - Translation_Entry::Translation_Entry + */ +}; diff --git a/config/sets/wp-5.5.php b/config/sets/wp-5.5.php new file mode 100644 index 0000000..1348bc7 --- /dev/null +++ b/config/sets/wp-5.5.php @@ -0,0 +1,43 @@ +ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ + new ReplaceFuncCallArgumentDefaultValue('add_action', 0, 'wp_blacklist_check', 'wp_check_comment_disallowed_list'), + new ReplaceFuncCallArgumentDefaultValue('add_filter', 0, 'whitelist_options', 'allowed_options'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'wp_unregister_GLOBALS', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + '_wp_register_meta_args_whitelist' => '_wp_register_meta_args_allowed_list', + 'add_option_whitelist' => 'add_allowed_options', + 'remove_option_whitelist' => 'remove_allowed_options', + 'wp_blacklist_check' => 'wp_check_comment_disallowed_list', + 'wp_make_content_images_responsive' => 'wp_filter_content_tags', + ]); + + /* + * TODO: these are not handled currently + * + * FILES + * - wp-includes/class-phpmailer.php + * - wp-includes/class-smtp.php + * + * + * add_option + * get_option + * update_option + * + * METHODS + * - WP_Community_Events::format_event_data_time + * - WP_REST_Post_Search_Handler::detect_rest_item_route + */ +}; diff --git a/config/sets/wp-5.6.php b/config/sets/wp-5.6.php new file mode 100644 index 0000000..600ec36 --- /dev/null +++ b/config/sets/wp-5.6.php @@ -0,0 +1,29 @@ +ruleWithConfiguration(RenameFunctionRector::class, [ + 'addslashes_strings_only' => 'wp_slash', + ]); + + /* + * TODO: these are not handled currently + * + * FILES + * -wp-includes/class-wp-feed-cache.php + * + * FUNCTIONS + * - wp_ajax_health_check_dotorg_communication + * - wp_ajax_health_check_background_updates + * - wp_ajax_health_check_loopback_requests + * - wp_ajax_health_check_get_sizes + * - wp_count_terms + * + * METHODS + * - WP_Community_Events::format_event_data_time + * - WP_REST_Meta_Fields::default_additional_properties_to_false + * - WP_REST_Meta_Fields::register_field + */ +}; diff --git a/config/sets/wp-5.7.php b/config/sets/wp-5.7.php new file mode 100644 index 0000000..62a0d5b --- /dev/null +++ b/config/sets/wp-5.7.php @@ -0,0 +1,21 @@ +ruleWithConfiguration(RenameFunctionRector::class, [ + '_excerpt_render_inner_columns_blocks' => '_excerpt_render_inner_blocks', + ]); + + /* + * TODO: these are not handled currently + * + * FILTERS + * - allowed_block_types + * - block_categories + * - block_editor_preload_paths + * - block_editor_settings + * - user_confirmed_action_email_content + * - user_erasure_complete_email_headers + * - user_erasure_complete_email_subject + */ +}; diff --git a/config/sets/wp-5.9.php b/config/sets/wp-5.9.php new file mode 100644 index 0000000..96bbebe --- /dev/null +++ b/config/sets/wp-5.9.php @@ -0,0 +1,39 @@ +ruleWithConfiguration(RemoveFuncCallArgRector::class, [ + new RemoveFuncCallArg('_load_remote_block_patterns', 0), + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'readonly' => 'wp_readonly', + 'wp_render_duotone_filter_preset' => 'wp_get_duotone_filter_property', + ]); + + $rectorConfig->ruleWithConfiguration(StaticCallToFuncCallRector::class, [ + new StaticCallToFuncCall('WP_Theme_JSON_Resolver', 'get_fields_to_translate', '__return_empty_array'), + ]); + + /* + * TODO: these are not handled currently + * + * FILES + * - wp-includes/class-http.php + * + * FUNCTIONS + * - _load_remote_block_patterns + * + * METHODS + * - WP_Theme_JSON::get_stylesheet + * - WP_Theme_JSON_Resolver::get_merged_data + * - WP_Theme_JSON_Resolver::get_theme_data + * - WP_User_Query::prepare_query + */ +}; diff --git a/config/sets/wp-6.0.php b/config/sets/wp-6.0.php new file mode 100644 index 0000000..98ffa53 --- /dev/null +++ b/config/sets/wp-6.0.php @@ -0,0 +1,28 @@ +ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'wp_add_iframed_editor_assets_html', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'image_attachment_fields_to_save', + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - the_meta + * + * METHODS + * - WP_Theme_JSON::should_override_preset + * + * PROPERTIES + * - PHPMailer::$SingleTo + */ +}; diff --git a/config/sets/wp-6.1.php b/config/sets/wp-6.1.php new file mode 100644 index 0000000..a4682c3 --- /dev/null +++ b/config/sets/wp-6.1.php @@ -0,0 +1,38 @@ +ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'install_global_terms', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'global_terms_enabled' => '__return_false', + ]); + + $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + '_wp_multiple_block_styles', + 'global_terms', + 'sync_category_tag_slugs', + ]); + + /* + * TODO: these are not handled currently + * + * FILES + * - wp-includes/class.wp-db.php + * - wp-includes/class.wp-dependencies.php + * - wp-includes/class.wp-scripts.php + * - wp-includes/class.wp-styles.php + * + * FUNCTIONS + * - wp_get_attachment_thumb_file + * + * METHODS + * - WP_REST_Settings_Controller::set_additional_properties_to_false + */ +}; diff --git a/config/sets/wp-6.2.php b/config/sets/wp-6.2.php new file mode 100644 index 0000000..17a766a --- /dev/null +++ b/config/sets/wp-6.2.php @@ -0,0 +1,24 @@ +ruleWithConfiguration(StaticCallToFuncCallRector::class, [ + new StaticCallToFuncCall('WP_Theme_JSON_Resolver', 'theme_has_support', 'wp_theme_has_theme_json'), + ]); + + /* + * TODO: these are not handled currently + * + * CLASSES + * - Requests + * + * FUNCTIONS + * - get_page_by_title + * + * METHODS + * - WP_Media_List_Table::column_desc + */ +}; diff --git a/config/sets/wp-6.3.php b/config/sets/wp-6.3.php new file mode 100644 index 0000000..fbc54ff --- /dev/null +++ b/config/sets/wp-6.3.php @@ -0,0 +1,58 @@ +ruleWithConfiguration(ParameterAdderRector::class, [ + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_comment_meta', 1, 0), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_comment_meta', 2, ''), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_comment_meta', 3, false), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_comment_meta', 4, 'comment'), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_term_meta', 1, 0), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_term_meta', 2, ''), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_term_meta', 3, false), + new MethodParameterAdder('WP_Metadata_Lazyloader', 'lazyload_term_meta', 4, 'term'), + ]); + + $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [ + 'wlwmanifest_link', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + 'block_core_navigation_submenu_build_css_colors' => 'block_core_navigation_link_build_css_colors', + 'wp_img_tag_add_loading_attr' => 'wp_img_tag_add_loading_optimization_attrs', + ]); + + $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ + new MethodCallRename('WP_Metadata_Lazyloader', 'lazyload_comment_meta', 'lazyload_meta_callback'), + new MethodCallRename('WP_Metadata_Lazyloader', 'lazyload_term_meta', 'lazyload_meta_callback'), + ]); + + /* + * TODO: these are not handled currently + * + * FILES + * - wp-admin/media.php + * + * FUNCTIONS + * - block_core_navigation_get_classic_menu_fallback + * - block_core_navigation_get_classic_menu_fallback_blocks + * - block_core_navigation_get_most_recently_published_navigation + * - block_core_navigation_maybe_use_classic_menu_fallback + * - block_core_navigation_parse_blocks_from_menu_items + * - wp_get_global_styles_svg_filters + * - wp_get_loading_attr_default + * - wp_global_styles_render_svg_filters + * - wp_queue_comments_for_comment_meta_lazyload + * + * METHODS + * - WP_Image_Editor_Imagick::set_imagick_time_limit + * - WP_Scripts::print_inline_script + */ +}; diff --git a/config/sets/wp-6.4.php b/config/sets/wp-6.4.php new file mode 100644 index 0000000..ddfef34 --- /dev/null +++ b/config/sets/wp-6.4.php @@ -0,0 +1,34 @@ +ruleWithConfiguration(ConstToFuncCallRector::class, [ + 'STYLESHEETPATH' => 'get_stylesheet_directory', + 'TEMPLATEPATH' => 'get_template_directory', + ]); + + $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ + '_admin_bar_bump_cb' => 'wp_enqueue_admin_bar_bump_styles', + 'print_embed_styles' => 'wp_enqueue_embed_styles', + 'print_emoji_styles' => 'wp_enqueue_emoji_styles', + 'wp_admin_bar_header' => 'wp_enqueue_admin_bar_header_styles', + 'wp_img_tag_add_decoding_attr' => 'wp_img_tag_add_loading_optimization_attrs', + ]); + + /* + * TODO: these are not handled currently + * + * CLASSES + * - WP_Http_Curl + * - WP_Http_Streams + * + * FILTERS + * - http_api_transports + * + * METHODS + * - WP_Http::_get_first_available_transport + */ +}; diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..9a88bf6 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,17 @@ +parameters: + level: max + + paths: + - config + - src + - tests + + reportUnmatchedIgnoredErrors: false + treatPhpDocTypesAsCertain: false + + ignoreErrors: + - '#^Parameter \#1 \$node (.*?) of method Fsylum\\RectorWordPress\\(.*?)\:\:refactor\(\) should be contravariant with parameter \$node \(PhpParser\\Node\) of method Rector\\Contract\\Rector\\RectorInterface\:\:refactor\(\)$#' + - '#^Parameter \#1 \$configuration (.*?) of method Fsylum\\RectorWordPress\\(.*?)\:\:configure\(\) should be contravariant with parameter \$configuration \(array\) of method Rector\\Contract\\Rector\\ConfigurableRectorInterface\:\:configure\(\)$#' + - '#^Return type \(int\|null\) of method Fsylum\\RectorWordPress\\Rules\\MethodCall\\RemoveMethodCallRector\:\:refactor\(\) should be covariant with return type \(1\|2\|3\|4\|array\\|PhpParser\\Node\|null\) of method Rector\\Contract\\Rector\\RectorInterface\:\:refactor\(\)$#' + - '#^Parameter \#1 \$items of class PhpParser\\Node\\Expr\\Array_ constructor expects array\, array\ given\.$#' + - '#^Parameter \#1 \$value of static method PhpParser\\BuilderHelpers\:\:normalizeValue\(\) expects array\|bool\|float\|int\|PhpParser\\Node\\Expr\|string\|null, mixed given\.$#' diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..ffc6b23 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,15 @@ + + + + + tests + + + diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..ac8539e --- /dev/null +++ b/pint.json @@ -0,0 +1,239 @@ +{ + "preset": "psr12", + "rules": { + "align_multiline_comment": { + "comment_type": "phpdocs_like" + }, + "array_indentation": true, + "array_push": true, + "array_syntax": true, + "assign_null_coalescing_to_coalesce_equal": true, + "attribute_empty_parentheses": true, + "backtick_to_shell_exec": true, + "binary_operator_spaces": { + "operators": { + "=": "align_single_space", + "=>": "align_single_space_minimal" + } + }, + "blank_line_before_statement": { + "statements": [ + "continue", + "declare", + "default", + "do", + "exit", + "for", + "foreach", + "goto", + "if", + "phpdoc", + "return", + "switch", + "throw", + "try", + "while", + "yield", + "yield_from" + ] + }, + "cast_spaces": true, + "class_attributes_separation": true, + "class_definition": { + "multi_line_extends_each_single_line": true, + "single_item_single_line": true, + "space_before_parenthesis": true + }, + "class_reference_name_casing": true, + "clean_namespace": true, + "combine_consecutive_issets": true, + "combine_consecutive_unsets": true, + "combine_nested_dirname": true, + "concat_space": { + "spacing": "one" + }, + "declare_parentheses": true, + "dir_constant": true, + "echo_tag_syntax": true, + "empty_loop_body": { + "style": "braces" + }, + "empty_loop_condition": true, + "ereg_to_preg": true, + "explicit_indirect_variable": true, + "explicit_string_variable": true, + "fopen_flag_order": true, + "fopen_flags": true, + "fully_qualified_strict_types": true, + "function_to_constant": true, + "function_typehint_space": true, + "get_class_to_class_keyword": true, + "global_namespace_import": true, + "heredoc_indentation": true, + "heredoc_to_nowdoc": true, + "implode_call": true, + "include": true, + "increment_style": { + "style": "post" + }, + "integer_literal_case": true, + "lambda_not_used_import": true, + "linebreak_after_opening_tag": true, + "list_syntax": true, + "logical_operators": true, + "magic_constant_casing": true, + "magic_method_casing": true, + "mb_str_functions": true, + "method_chaining_indentation": true, + "modernize_strpos": true, + "modernize_types_casting": true, + "multiline_whitespace_before_semicolons": true, + "native_function_casing": true, + "native_type_declaration_casing": true, + "new_with_parentheses": { + "anonymous_class": false, + "named_class": false + }, + "no_alias_functions": true, + "no_alias_language_construct_call": true, + "no_binary_string": true, + "no_blank_lines_after_phpdoc": true, + "no_empty_comment": true, + "no_empty_phpdoc": true, + "no_empty_statement": true, + "no_extra_blank_lines": { + "tokens": [ + "attribute", + "case", + "continue", + "curly_brace_block", + "default", + "extra", + "parenthesis_brace_block", + "return", + "square_brace_block", + "switch", + "throw", + "use", + "use_trait" + ] + }, + "no_homoglyph_names": true, + "no_leading_namespace_whitespace": true, + "no_mixed_echo_print": true, + "no_multiline_whitespace_around_double_arrow": true, + "no_null_property_initialization": true, + "no_php4_constructor": true, + "no_short_bool_cast": true, + "no_singleline_whitespace_before_semicolons": true, + "no_spaces_around_offset": true, + "no_superfluous_elseif": true, + "no_trailing_comma_in_singleline": true, + "no_unneeded_braces": true, + "no_unneeded_control_parentheses": true, + "no_unneeded_import_alias": true, + "no_unreachable_default_argument_value": true, + "no_unset_cast": true, + "no_unset_on_property": true, + "no_unused_imports": true, + "no_useless_concat_operator": true, + "no_useless_else": true, + "no_useless_nullsafe_operator": true, + "no_useless_return": true, + "no_useless_sprintf": true, + "no_whitespace_before_comma_in_array": true, + "normalize_index_brace": true, + "nullable_type_declaration": true, + "nullable_type_declaration_for_default_null_value": true, + "object_operator_without_whitespace": true, + "octal_notation": true, + "operator_linebreak": true, + "ordered_interfaces": true, + "ordered_traits": true, + "ordered_types": true, + "php_unit_construct": true, + "php_unit_data_provider_name": true, + "php_unit_data_provider_static": true, + "php_unit_dedicate_assert": true, + "php_unit_dedicate_assert_internal_type": true, + "php_unit_expectation": true, + "php_unit_internal_class": true, + "php_unit_method_casing": { + "case": "snake_case" + }, + "php_unit_mock": true, + "php_unit_mock_short_will_return": true, + "php_unit_namespaced": true, + "php_unit_set_up_tear_down_visibility": true, + "php_unit_test_annotation": true, + "php_unit_test_case_static_method_calls": true, + "phpdoc_add_missing_param_annotation": true, + "phpdoc_align": true, + "phpdoc_indent": true, + "phpdoc_inline_tag_normalizer": true, + "phpdoc_line_span": true, + "phpdoc_no_access": true, + "phpdoc_no_alias_tag": true, + "phpdoc_no_package": true, + "phpdoc_no_useless_inheritdoc": true, + "phpdoc_order": true, + "phpdoc_param_order": true, + "phpdoc_readonly_class_comment_to_keyword": true, + "phpdoc_return_self_reference": true, + "phpdoc_scalar": true, + "phpdoc_separation": true, + "phpdoc_single_line_var_spacing": true, + "phpdoc_summary": true, + "phpdoc_tag_casing": true, + "phpdoc_tag_type": true, + "phpdoc_to_comment": true, + "phpdoc_trim": true, + "phpdoc_trim_consecutive_blank_line_separation": true, + "phpdoc_types": true, + "phpdoc_types_order": true, + "phpdoc_var_annotation_correct_order": true, + "phpdoc_var_without_name": true, + "pow_to_exponentiation": true, + "protected_to_private": true, + "random_api_migration": true, + "regular_callable_call": true, + "return_assignment": true, + "self_accessor": true, + "self_static_accessor": true, + "semicolon_after_instruction": true, + "set_type_to_cast": true, + "simple_to_complex_string_variable": true, + "simplified_if_return": true, + "simplified_null_return": true, + "single_line_comment_spacing": true, + "single_line_comment_style": true, + "single_line_empty_body": true, + "single_line_throw": true, + "single_quote": true, + "single_space_around_construct": true, + "space_after_semicolon": true, + "standardize_not_equals": true, + "strict_comparison": true, + "strict_param": true, + "string_length_to_empty": true, + "string_line_ending": true, + "switch_continue_to_break": true, + "ternary_to_elvis_operator": true, + "ternary_to_null_coalescing": true, + "trailing_comma_in_multiline": true, + "trim_array_spaces": true, + "type_declaration_spaces": true, + "types_spaces": true, + "unary_operator_spaces": true, + "use_arrow_functions": true, + "void_return": true, + "whitespace_after_comma_in_array": { + "ensure_single_space": true + }, + "yoda_style": { + "equal": false, + "identical": false, + "less_and_greater": false + } + } +} diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..3e49551 --- /dev/null +++ b/rector.php @@ -0,0 +1,23 @@ +importNames(); + + $rectorConfig->paths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_82, + SetList::DEAD_CODE, + SetList::CODE_QUALITY, + SetList::NAMING, + ]); +}; diff --git a/src/Rules/ConstFetch/ConstToFuncCallRector.php b/src/Rules/ConstFetch/ConstToFuncCallRector.php new file mode 100644 index 0000000..742a25e --- /dev/null +++ b/src/Rules/ConstFetch/ConstToFuncCallRector.php @@ -0,0 +1,75 @@ + + */ + private array $configuration = []; + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition('Changes constants use to function calls', [new ConfiguredCodeSample(<<<'CODE_SAMPLE' + class SomeClass + { + public function run() + { + $value = PHP_SAPI; + } + } + CODE_SAMPLE + , <<<'CODE_SAMPLE' + class SomeClass + { + public function run() + { + $value = php_sapi_name(); + } + } + CODE_SAMPLE + , ['PHP_SAPI' => 'php_sapi_name'])]); + } + + public function getNodeTypes(): array + { + return [ConstFetch::class]; + } + + public function refactor(Node $node): ?Node + { + $const = $this->getName($node); + + if (!is_string($const)) { + return null; + } + + if (!array_key_exists($const, $this->configuration)) { + return null; + } + + return new FuncCall(new FullyQualified($this->configuration[$const])); + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allString($configuration); + Assert::allString(\array_keys($configuration)); + + $this->configuration = $configuration; + } +} diff --git a/src/Rules/Deprecated/Functions/TheEditorRector.php b/src/Rules/Deprecated/Functions/TheEditorRector.php new file mode 100644 index 0000000..6a73d39 --- /dev/null +++ b/src/Rules/Deprecated/Functions/TheEditorRector.php @@ -0,0 +1,61 @@ +isName($node, 'the_editor')) { + return null; + } + + if ($node->isFirstClassCallable()) { + return null; + } + + $arrayItem = new ArrayItem($node->getArgs()[3]->value, new String_('media_buttons')); + $arguments = $this->nodeFactory->createArgs([ + $node->getArgs()[0], + $node->getArgs()[1], + new Array_([$arrayItem]), + ]); + + return $this->nodeFactory->createFuncCall('wp_editor', $arguments); + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Change `the_editor` to equivalent `wp_editor`.', + [ + new CodeSample( + <<<'CODE_SAMPLE' + the_editor($content, 'content', 'title', true); + CODE_SAMPLE + , + <<<'CODE_SAMPLE' + wp_editor($content, 'content', ['media_buttons' => true]); + CODE_SAMPLE + ), + ] + ); + } +} diff --git a/src/Rules/Deprecated/Functions/WpKsesJsEntitiesRector.php b/src/Rules/Deprecated/Functions/WpKsesJsEntitiesRector.php new file mode 100644 index 0000000..bca73ff --- /dev/null +++ b/src/Rules/Deprecated/Functions/WpKsesJsEntitiesRector.php @@ -0,0 +1,53 @@ +isName($node, 'wp_kses_js_entities')) { + return null; + } + + if ($node->isFirstClassCallable()) { + return null; + } + + $args1 = new Arg(new String_('%&\s*\{[^}]*(\}\s*;?|$)%')); + $args2 = new Arg(new String_('')); + + $arguments = $this->nodeFactory->createArgs([$args1, $args2, $node->getArgs()[0]]); + + return $this->nodeFactory->createFuncCall('preg_replace', $arguments); + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Change `wp_kses_js_entities` to equivalent `preg_replace`.', + [ + new CodeSample( + 'wp_kses_js_entities($foo);', + 'preg_replace("%&\s*\{[^}]*(\}\s*;?|$)%", "", $foo);' + ), + ] + ); + } +} diff --git a/src/Rules/FuncCall/ParameterAdderRector.php b/src/Rules/FuncCall/ParameterAdderRector.php new file mode 100644 index 0000000..b7a38b0 --- /dev/null +++ b/src/Rules/FuncCall/ParameterAdderRector.php @@ -0,0 +1,74 @@ + + */ + private array $configuration = []; + + public function getNodeTypes(): array + { + return [FuncCall::class]; + } + + /** + * @param FuncCall $node + */ + public function refactor(Node $node): ?Node + { + foreach ($this->configuration as $config) { + if (!$this->isName($node->name, $config->getFunction())) { + continue; + } + + $position = $config->getPosition(); + $arg = new Arg(BuilderHelpers::normalizeValue($config->getValue())); + + if (isset($node->args[$position])) { + continue; + } + + $node->args[$position] = $arg; + } + + return $node; + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allIsAOf($configuration, FunctionParameterAdder::class); + + $this->configuration = $configuration; + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Add additional parameter to the function call', + [ + new ConfiguredCodeSample( + 'someMethod("foo");', + 'someMethod("foo", "bar);', + [new FunctionParameterAdder('someMethod', 1, 'bar')] + ), + ] + ); + } +} diff --git a/src/Rules/FuncCall/ParameterPrependerRector.php b/src/Rules/FuncCall/ParameterPrependerRector.php new file mode 100644 index 0000000..e9d5e86 --- /dev/null +++ b/src/Rules/FuncCall/ParameterPrependerRector.php @@ -0,0 +1,73 @@ + + */ + private array $configuration = []; + + public function getNodeTypes(): array + { + return [FuncCall::class]; + } + + /** + * @param FuncCall $node + */ + public function refactor(Node $node): ?Node + { + foreach ($this->configuration as $config) { + if (!$this->isName($node->name, $config->getFunction())) { + continue; + } + + $arg = new Arg(BuilderHelpers::normalizeValue($config->getValue())); + + $args = $node->args; + + array_unshift($args, $arg); + + $node->args = $args; + } + + return $node; + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allIsAOf($configuration, FunctionParameterPrepender::class); + + $this->configuration = $configuration; + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Prepend additional parameter to the start of the function call', + [ + new ConfiguredCodeSample( + 'someMethod("bar', + 'someMethod("foo", "bar);', + [new FunctionParameterPrepender('someMethod', 'foo')] + ), + ] + ); + } +} diff --git a/src/Rules/FuncCall/ReturnFirstArgumentRector.php b/src/Rules/FuncCall/ReturnFirstArgumentRector.php new file mode 100644 index 0000000..cecdb6b --- /dev/null +++ b/src/Rules/FuncCall/ReturnFirstArgumentRector.php @@ -0,0 +1,68 @@ + + */ + private array $configuration; + + public function getNodeTypes(): array + { + return [FuncCall::class]; + } + + /** + * @param FuncCall $node + */ + public function refactor(Node $node): ?Node + { + if (count($node->args) === 0) { + return null; + } + + foreach ($this->configuration as $function) { + if (!$this->isName($node->name, $function)) { + continue; + } + + return $node->args[0]; + } + + return null; + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allString($configuration); + + $this->configuration = $configuration; + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Replace function call directly with its first argument', + [ + new ConfiguredCodeSample( + '$test = my_func($foo);', + '$test = $foo;', + ['my_func'] + ), + ] + ); + } +} diff --git a/src/Rules/MethodCall/ParameterAdderRector.php b/src/Rules/MethodCall/ParameterAdderRector.php new file mode 100644 index 0000000..a96f140 --- /dev/null +++ b/src/Rules/MethodCall/ParameterAdderRector.php @@ -0,0 +1,124 @@ + + */ + private array $configuration = []; + + private bool $hasChanged = false; + + public function getNodeTypes(): array + { + return [MethodCall::class, StaticCall::class]; + } + + /** + * @param MethodCall|StaticCall $node + */ + public function refactor(Node $node): ?Node + { + foreach ($this->configuration as $config) { + if (!$this->isObjectTypeMatch($node, $config->getObjectType())) { + continue; + } + + if (!$this->isName($node->name, $config->getMethod())) { + continue; + } + + $position = $config->getPosition(); + $arg = new Arg(BuilderHelpers::normalizeValue($config->getValue())); + + if ($node instanceof StaticCall) { + $this->processStaticCall($node, $position, $arg); + } + + if ($node instanceof MethodCall) { + $this->processMethodCall($node, $position, $arg); + } + } + + if ($this->hasChanged) { + return $node; + } + + return null; + } + + private function processStaticCall(StaticCall $staticCall, int $position, Arg $arg): void + { + if (isset($staticCall->args[$position])) { + return; + } + + $staticCall->args[$position] = $arg; + $this->hasChanged = true; + } + + private function processMethodCall(MethodCall $methodCall, int $position, Arg $arg): void + { + if (isset($methodCall->args[$position])) { + return; + } + + $methodCall->args[$position] = $arg; + $this->hasChanged = true; + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allIsAOf($configuration, MethodParameterAdder::class); + + $this->configuration = $configuration; + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Add additional parameter to the method call', + [ + new ConfiguredCodeSample( + <<<'CODE_SAMPLE' + $someObject = new SomeExampleClass; + $someObject->someMethod('foo'); + CODE_SAMPLE + , + <<<'CODE_SAMPLE' + $someObject = new SomeExampleClass; + $someObject->someMethod('foo', 'bar'); + CODE_SAMPLE, + [new MethodParameterAdder('SomeExampleClass', 'someMethod', 1, 'bar')] + ), + ] + ); + } + + private function isObjectTypeMatch(MethodCall|StaticCall $call, ObjectType $objectType): bool + { + if ($call instanceof MethodCall) { + return $this->isObjectType($call->var, $objectType); + } + + return $this->isObjectType($call->class, $objectType); + } +} diff --git a/src/Rules/MethodCall/RemoveMethodCallRector.php b/src/Rules/MethodCall/RemoveMethodCallRector.php new file mode 100644 index 0000000..18bcb4f --- /dev/null +++ b/src/Rules/MethodCall/RemoveMethodCallRector.php @@ -0,0 +1,91 @@ + + */ + private array $configuration = []; + + public function getNodeTypes(): array + { + return [Expression::class]; + } + + /** + * @param Expression $node + */ + public function refactor(Node $node): ?int + { + $expr = $node->expr; + + if (!$expr instanceof MethodCall) { + return null; + } + + foreach ($this->configuration as $method => $class) { + if (!$this->isObjectTypeMatch($expr, $class)) { + continue; + } + + if (!$this->isName($expr->name, $method)) { + continue; + } + + return NodeTraverser::REMOVE_NODE; + } + + return null; + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allString(array_values($configuration)); + Assert::allString($configuration); + + $this->configuration = $configuration; + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Remove method call from the specified class', + [ + new ConfiguredCodeSample( + <<<'CODE_SAMPLE' + $someObject = new SomeExampleClass; + $someObject->someMethod('foo'); + CODE_SAMPLE + , + <<<'CODE_SAMPLE' + $someObject = new SomeExampleClass; + CODE_SAMPLE, + ['someMethod' => 'SomeExampleClass'] + ), + ] + ); + } + + private function isObjectTypeMatch(MethodCall $call, string $class): bool + { + $objectType = new ObjectType($class); + + return $this->isObjectType($call->var, $objectType); + } +} diff --git a/src/Rules/MethodCall/ReturnFirstArgumentRector.php b/src/Rules/MethodCall/ReturnFirstArgumentRector.php new file mode 100644 index 0000000..151fb73 --- /dev/null +++ b/src/Rules/MethodCall/ReturnFirstArgumentRector.php @@ -0,0 +1,88 @@ + + */ + private array $configuration; + + public function getNodeTypes(): array + { + return [MethodCall::class]; + } + + /** + * @param MethodCall $node + */ + public function refactor(Node $node): ?Node + { + if (count($node->args) === 0) { + return null; + } + + foreach ($this->configuration as $method => $class) { + if (!$this->isObjectTypeMatch($node, $class)) { + continue; + } + + if (!$this->isName($node->name, $method)) { + continue; + } + + return $node->args[0]; + } + + return null; + } + + /** + * @param array $configuration + */ + public function configure(array $configuration): void + { + Assert::allString(array_values($configuration)); + Assert::allString($configuration); + + $this->configuration = $configuration; + } + + public function getRuleDefinition(): RuleDefinition + { + return new RuleDefinition( + 'Replace method call directly with its first argument', + [ + new ConfiguredCodeSample( + <<<'CODE_SAMPLE' + $someObject = new SomeExampleClass; + $foo = $someObject->someMethod('foo'); + CODE_SAMPLE + , + <<<'CODE_SAMPLE' + $someObject = new SomeExampleClass; + $foo = 'foo'; + CODE_SAMPLE, + ['someMethod' => 'SomeExampleClass'] + ), + ] + ); + } + + private function isObjectTypeMatch(MethodCall $call, string $class): bool + { + $objectType = new ObjectType($class); + + return $this->isObjectType($call->var, $objectType); + } +} diff --git a/src/Set/WordPressLevelSetList.php b/src/Set/WordPressLevelSetList.php new file mode 100644 index 0000000..377cd41 --- /dev/null +++ b/src/Set/WordPressLevelSetList.php @@ -0,0 +1,104 @@ +function; + } + + public function getPosition(): int + { + return $this->position; + } + + public function getValue(): mixed + { + return $this->value; + } +} diff --git a/src/ValueObject/FunctionParameterPrepender.php b/src/ValueObject/FunctionParameterPrepender.php new file mode 100644 index 0000000..18754eb --- /dev/null +++ b/src/ValueObject/FunctionParameterPrepender.php @@ -0,0 +1,18 @@ +function; + } + + public function getValue(): mixed + { + return $this->value; + } +} diff --git a/src/ValueObject/MethodParameterAdder.php b/src/ValueObject/MethodParameterAdder.php new file mode 100644 index 0000000..f16a1c1 --- /dev/null +++ b/src/ValueObject/MethodParameterAdder.php @@ -0,0 +1,30 @@ +class); + } + + public function getMethod(): string + { + return $this->method; + } + + public function getPosition(): int + { + return $this->position; + } + + public function getValue(): mixed + { + return $this->value; + } +} diff --git a/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/ConstToFuncCallRectorTest.php b/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/ConstToFuncCallRectorTest.php new file mode 100644 index 0000000..49b757c --- /dev/null +++ b/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/ConstToFuncCallRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/config.php b/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/config.php new file mode 100644 index 0000000..007bc2f --- /dev/null +++ b/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/config.php @@ -0,0 +1,10 @@ +ruleWithConfiguration(ConstToFuncCallRector::class, [ + 'PHP_SAPI' => 'php_sapi_name', + ]); +}; diff --git a/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/test_fixture.php.inc b/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/test_fixture.php.inc new file mode 100644 index 0000000..ea0eb70 --- /dev/null +++ b/tests/Rector/Rules/ConstFetch/ConstToFuncCallRector/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/TheEditorRectorTest.php b/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/TheEditorRectorTest.php new file mode 100644 index 0000000..9ab8276 --- /dev/null +++ b/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/TheEditorRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/config.php b/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/config.php new file mode 100644 index 0000000..6ea6005 --- /dev/null +++ b/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/config.php @@ -0,0 +1,8 @@ +rule(TheEditorRector::class); +}; diff --git a/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/test_fixture.php.inc b/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/test_fixture.php.inc new file mode 100644 index 0000000..0137191 --- /dev/null +++ b/tests/Rector/Rules/Deprecated/Functions/TheEditorRector/test_fixture.php.inc @@ -0,0 +1,19 @@ + +----- + false]); +wp_editor($foo, 'bar', ['media_buttons' => $media]); + +?> diff --git a/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/WpKsesJsEntitiesRectorTest.php b/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/WpKsesJsEntitiesRectorTest.php new file mode 100644 index 0000000..d12ae3d --- /dev/null +++ b/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/WpKsesJsEntitiesRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/config.php b/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/config.php new file mode 100644 index 0000000..55bfe92 --- /dev/null +++ b/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/config.php @@ -0,0 +1,8 @@ +rule(WpKsesJsEntitiesRector::class); +}; diff --git a/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/test_fixture.php.inc b/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/test_fixture.php.inc new file mode 100644 index 0000000..92f38e5 --- /dev/null +++ b/tests/Rector/Rules/Deprecated/Functions/WpKsesJsEntitiesRector/test_fixture.php.inc @@ -0,0 +1,13 @@ + +----- + diff --git a/tests/Rector/Rules/FuncCall/ParameterAdderRector/ParameterAdderRectorTest.php b/tests/Rector/Rules/FuncCall/ParameterAdderRector/ParameterAdderRectorTest.php new file mode 100644 index 0000000..5c1a735 --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ParameterAdderRector/ParameterAdderRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/FuncCall/ParameterAdderRector/config.php b/tests/Rector/Rules/FuncCall/ParameterAdderRector/config.php new file mode 100644 index 0000000..015ea15 --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ParameterAdderRector/config.php @@ -0,0 +1,12 @@ +ruleWithConfiguration(ParameterAdderRector::class, [ + new FunctionParameterAdder('wp_rel_nofollow_callback', 1, 'nofollow'), + new FunctionParameterAdder('wp_rel_nofollow_callback', 2, false), + ]); +}; diff --git a/tests/Rector/Rules/FuncCall/ParameterAdderRector/test_fixture.php.inc b/tests/Rector/Rules/FuncCall/ParameterAdderRector/test_fixture.php.inc new file mode 100644 index 0000000..f08f7c9 --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ParameterAdderRector/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Rules/FuncCall/ParameterPrependerRector/ParameterPrependerRectorTest.php b/tests/Rector/Rules/FuncCall/ParameterPrependerRector/ParameterPrependerRectorTest.php new file mode 100644 index 0000000..042507b --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ParameterPrependerRector/ParameterPrependerRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/FuncCall/ParameterPrependerRector/config.php b/tests/Rector/Rules/FuncCall/ParameterPrependerRector/config.php new file mode 100644 index 0000000..fb3b8f9 --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ParameterPrependerRector/config.php @@ -0,0 +1,11 @@ +ruleWithConfiguration(ParameterPrependerRector::class, [ + new FunctionParameterPrepender('get_user_by_email', 'email'), + ]); +}; diff --git a/tests/Rector/Rules/FuncCall/ParameterPrependerRector/test_fixture.php.inc b/tests/Rector/Rules/FuncCall/ParameterPrependerRector/test_fixture.php.inc new file mode 100644 index 0000000..1eac3fc --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ParameterPrependerRector/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php b/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php new file mode 100644 index 0000000..0983b88 --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/config.php b/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/config.php new file mode 100644 index 0000000..4a68daa --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/config.php @@ -0,0 +1,10 @@ +ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + '_wp_multiple_block_styles', + ]); +}; diff --git a/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/test_fixture.php.inc b/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/test_fixture.php.inc new file mode 100644 index 0000000..719b5a0 --- /dev/null +++ b/tests/Rector/Rules/FuncCall/ReturnFirstArgumentRector/test_fixture.php.inc @@ -0,0 +1,29 @@ + +----- + diff --git a/tests/Rector/Rules/MethodCall/ParameterAdderRector/ParameterAdderRectorTest.php b/tests/Rector/Rules/MethodCall/ParameterAdderRector/ParameterAdderRectorTest.php new file mode 100644 index 0000000..7bf1b84 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/ParameterAdderRector/ParameterAdderRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/MethodCall/ParameterAdderRector/config.php b/tests/Rector/Rules/MethodCall/ParameterAdderRector/config.php new file mode 100644 index 0000000..04072b1 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/ParameterAdderRector/config.php @@ -0,0 +1,13 @@ +ruleWithConfiguration(ParameterAdderRector::class, [ + new MethodParameterAdder('WP_Query', 'get', 1, 'bar'), + new MethodParameterAdder('WP_Query', 'get', 2, 10), + new MethodParameterAdder('SimplePie', 'merge_items', 1, 5), + ]); +}; diff --git a/tests/Rector/Rules/MethodCall/ParameterAdderRector/test_fixture.php.inc b/tests/Rector/Rules/MethodCall/ParameterAdderRector/test_fixture.php.inc new file mode 100644 index 0000000..3237e87 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/ParameterAdderRector/test_fixture.php.inc @@ -0,0 +1,21 @@ +get('foo'); +$foo = $class->fill_query_vars(['bar']); + +$bar = SimplePie::merge_items(['foo', 'bar']); +SimplePie::sort_items(new SimplePie(), new SimplePie()); + +?> +----- +get('foo', 'bar', 10); +$foo = $class->fill_query_vars(['bar']); + +$bar = SimplePie::merge_items(['foo', 'bar'], 5); +SimplePie::sort_items(new SimplePie(), new SimplePie()); + +?> diff --git a/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/RemoveMethodCallRectorTest.php b/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/RemoveMethodCallRectorTest.php new file mode 100644 index 0000000..4bcb521 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/RemoveMethodCallRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/config.php b/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/config.php new file mode 100644 index 0000000..2bad8d5 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/config.php @@ -0,0 +1,10 @@ +ruleWithConfiguration(RemoveMethodCallRector::class, [ + 'get' => 'WP_Query', + ]); +}; diff --git a/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/test_fixture.php.inc b/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/test_fixture.php.inc new file mode 100644 index 0000000..5db0c2d --- /dev/null +++ b/tests/Rector/Rules/MethodCall/RemoveMethodCallRector/test_fixture.php.inc @@ -0,0 +1,14 @@ +get('foo'); +$foo = $class->fill_query_vars(['bar']); + +?> +----- +fill_query_vars(['bar']); + +?> diff --git a/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php b/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php new file mode 100644 index 0000000..f57ccc7 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/ReturnFirstArgumentRectorTest.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config.php'; + } +} diff --git a/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/config.php b/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/config.php new file mode 100644 index 0000000..eae5f8e --- /dev/null +++ b/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/config.php @@ -0,0 +1,10 @@ +ruleWithConfiguration(ReturnFirstArgumentRector::class, [ + 'get' => 'WP_Query', + ]); +}; diff --git a/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/test_fixture.php.inc b/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/test_fixture.php.inc new file mode 100644 index 0000000..48f18a4 --- /dev/null +++ b/tests/Rector/Rules/MethodCall/ReturnFirstArgumentRector/test_fixture.php.inc @@ -0,0 +1,13 @@ +get('foo'); + +?> +----- + diff --git a/tests/Rector/Sets/Wp071/Wp071Test.php b/tests/Rector/Sets/Wp071/Wp071Test.php new file mode 100644 index 0000000..8a7b886 --- /dev/null +++ b/tests/Rector/Sets/Wp071/Wp071Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-0.71.php'; + } +} diff --git a/tests/Rector/Sets/Wp071/test_fixture.php.inc b/tests/Rector/Sets/Wp071/test_fixture.php.inc new file mode 100644 index 0000000..26d91b5 --- /dev/null +++ b/tests/Rector/Sets/Wp071/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp10/Wp10Test.php b/tests/Rector/Sets/Wp10/Wp10Test.php new file mode 100644 index 0000000..bb9c324 --- /dev/null +++ b/tests/Rector/Sets/Wp10/Wp10Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-1.0.php'; + } +} diff --git a/tests/Rector/Sets/Wp10/test_fixture.php.inc b/tests/Rector/Sets/Wp10/test_fixture.php.inc new file mode 100644 index 0000000..24c8fcc --- /dev/null +++ b/tests/Rector/Sets/Wp10/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp12/Wp12Test.php b/tests/Rector/Sets/Wp12/Wp12Test.php new file mode 100644 index 0000000..fe4f17b --- /dev/null +++ b/tests/Rector/Sets/Wp12/Wp12Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-1.2.php'; + } +} diff --git a/tests/Rector/Sets/Wp12/test_fixture.php.inc b/tests/Rector/Sets/Wp12/test_fixture.php.inc new file mode 100644 index 0000000..487ba4a --- /dev/null +++ b/tests/Rector/Sets/Wp12/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp15/Wp15Test.php b/tests/Rector/Sets/Wp15/Wp15Test.php new file mode 100644 index 0000000..f769087 --- /dev/null +++ b/tests/Rector/Sets/Wp15/Wp15Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-1.5.php'; + } +} diff --git a/tests/Rector/Sets/Wp15/test_fixture.php.inc b/tests/Rector/Sets/Wp15/test_fixture.php.inc new file mode 100644 index 0000000..8d19bd1 --- /dev/null +++ b/tests/Rector/Sets/Wp15/test_fixture.php.inc @@ -0,0 +1,13 @@ + +----- + diff --git a/tests/Rector/Sets/Wp20/Wp20Test.php b/tests/Rector/Sets/Wp20/Wp20Test.php new file mode 100644 index 0000000..62f38b7 --- /dev/null +++ b/tests/Rector/Sets/Wp20/Wp20Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.0.php'; + } +} diff --git a/tests/Rector/Sets/Wp20/test_fixture.php.inc b/tests/Rector/Sets/Wp20/test_fixture.php.inc new file mode 100644 index 0000000..37dbfd8 --- /dev/null +++ b/tests/Rector/Sets/Wp20/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp21/Wp21Test.php b/tests/Rector/Sets/Wp21/Wp21Test.php new file mode 100644 index 0000000..c01fb36 --- /dev/null +++ b/tests/Rector/Sets/Wp21/Wp21Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.1.php'; + } +} diff --git a/tests/Rector/Sets/Wp21/test_fixture.php.inc b/tests/Rector/Sets/Wp21/test_fixture.php.inc new file mode 100644 index 0000000..5c9f555 --- /dev/null +++ b/tests/Rector/Sets/Wp21/test_fixture.php.inc @@ -0,0 +1,27 @@ + +----- + diff --git a/tests/Rector/Sets/Wp22/Wp22Test.php b/tests/Rector/Sets/Wp22/Wp22Test.php new file mode 100644 index 0000000..35c9dbd --- /dev/null +++ b/tests/Rector/Sets/Wp22/Wp22Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.2.php'; + } +} diff --git a/tests/Rector/Sets/Wp22/test_fixture.php.inc b/tests/Rector/Sets/Wp22/test_fixture.php.inc new file mode 100644 index 0000000..24c8fcc --- /dev/null +++ b/tests/Rector/Sets/Wp22/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp23/Wp23Test.php b/tests/Rector/Sets/Wp23/Wp23Test.php new file mode 100644 index 0000000..2889fec --- /dev/null +++ b/tests/Rector/Sets/Wp23/Wp23Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.3.php'; + } +} diff --git a/tests/Rector/Sets/Wp23/test_fixture.php.inc b/tests/Rector/Sets/Wp23/test_fixture.php.inc new file mode 100644 index 0000000..b090734 --- /dev/null +++ b/tests/Rector/Sets/Wp23/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp25/Wp25Test.php b/tests/Rector/Sets/Wp25/Wp25Test.php new file mode 100644 index 0000000..e3ae423 --- /dev/null +++ b/tests/Rector/Sets/Wp25/Wp25Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.5.php'; + } +} diff --git a/tests/Rector/Sets/Wp25/test_fixture.php.inc b/tests/Rector/Sets/Wp25/test_fixture.php.inc new file mode 100644 index 0000000..ae6e887 --- /dev/null +++ b/tests/Rector/Sets/Wp25/test_fixture.php.inc @@ -0,0 +1,23 @@ + +----- + diff --git a/tests/Rector/Sets/Wp26/Wp26Test.php b/tests/Rector/Sets/Wp26/Wp26Test.php new file mode 100644 index 0000000..1fbb33e --- /dev/null +++ b/tests/Rector/Sets/Wp26/Wp26Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.6.php'; + } +} diff --git a/tests/Rector/Sets/Wp26/test_fixture.php.inc b/tests/Rector/Sets/Wp26/test_fixture.php.inc new file mode 100644 index 0000000..24c8fcc --- /dev/null +++ b/tests/Rector/Sets/Wp26/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp27/Wp27Test.php b/tests/Rector/Sets/Wp27/Wp27Test.php new file mode 100644 index 0000000..8e796e2 --- /dev/null +++ b/tests/Rector/Sets/Wp27/Wp27Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.7.php'; + } +} diff --git a/tests/Rector/Sets/Wp27/test_fixture.php.inc b/tests/Rector/Sets/Wp27/test_fixture.php.inc new file mode 100644 index 0000000..0133185 --- /dev/null +++ b/tests/Rector/Sets/Wp27/test_fixture.php.inc @@ -0,0 +1,17 @@ + +----- + diff --git a/tests/Rector/Sets/Wp28/Wp28Test.php b/tests/Rector/Sets/Wp28/Wp28Test.php new file mode 100644 index 0000000..16af73d --- /dev/null +++ b/tests/Rector/Sets/Wp28/Wp28Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.8.php'; + } +} diff --git a/tests/Rector/Sets/Wp28/test_fixture.php.inc b/tests/Rector/Sets/Wp28/test_fixture.php.inc new file mode 100644 index 0000000..6f4e03c --- /dev/null +++ b/tests/Rector/Sets/Wp28/test_fixture.php.inc @@ -0,0 +1,85 @@ + +----- + diff --git a/tests/Rector/Sets/Wp29/Wp29Test.php b/tests/Rector/Sets/Wp29/Wp29Test.php new file mode 100644 index 0000000..b8ef31b --- /dev/null +++ b/tests/Rector/Sets/Wp29/Wp29Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-2.9.php'; + } +} diff --git a/tests/Rector/Sets/Wp29/test_fixture.php.inc b/tests/Rector/Sets/Wp29/test_fixture.php.inc new file mode 100644 index 0000000..24c8fcc --- /dev/null +++ b/tests/Rector/Sets/Wp29/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp30/Wp30Test.php b/tests/Rector/Sets/Wp30/Wp30Test.php new file mode 100644 index 0000000..017bcab --- /dev/null +++ b/tests/Rector/Sets/Wp30/Wp30Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.0.php'; + } +} diff --git a/tests/Rector/Sets/Wp30/test_fixture.php.inc b/tests/Rector/Sets/Wp30/test_fixture.php.inc new file mode 100644 index 0000000..cf967b1 --- /dev/null +++ b/tests/Rector/Sets/Wp30/test_fixture.php.inc @@ -0,0 +1,74 @@ + +----- + diff --git a/tests/Rector/Sets/Wp31/Wp31Test.php b/tests/Rector/Sets/Wp31/Wp31Test.php new file mode 100644 index 0000000..29a402b --- /dev/null +++ b/tests/Rector/Sets/Wp31/Wp31Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.1.php'; + } +} diff --git a/tests/Rector/Sets/Wp31/test_fixture.php.inc b/tests/Rector/Sets/Wp31/test_fixture.php.inc new file mode 100644 index 0000000..d9be53b --- /dev/null +++ b/tests/Rector/Sets/Wp31/test_fixture.php.inc @@ -0,0 +1,25 @@ + +----- + diff --git a/tests/Rector/Sets/Wp32/Wp32Test.php b/tests/Rector/Sets/Wp32/Wp32Test.php new file mode 100644 index 0000000..3b6c646 --- /dev/null +++ b/tests/Rector/Sets/Wp32/Wp32Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.2.php'; + } +} diff --git a/tests/Rector/Sets/Wp32/test_fixture.php.inc b/tests/Rector/Sets/Wp32/test_fixture.php.inc new file mode 100644 index 0000000..9604ece --- /dev/null +++ b/tests/Rector/Sets/Wp32/test_fixture.php.inc @@ -0,0 +1,17 @@ + +----- + diff --git a/tests/Rector/Sets/Wp33/Wp33Test.php b/tests/Rector/Sets/Wp33/Wp33Test.php new file mode 100644 index 0000000..74bec5e --- /dev/null +++ b/tests/Rector/Sets/Wp33/Wp33Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.3.php'; + } +} diff --git a/tests/Rector/Sets/Wp33/test_fixture.php.inc b/tests/Rector/Sets/Wp33/test_fixture.php.inc new file mode 100644 index 0000000..f91b940 --- /dev/null +++ b/tests/Rector/Sets/Wp33/test_fixture.php.inc @@ -0,0 +1,63 @@ +print_scripts_l10n('foo'); + +$foo = get_user_by_email('bar'); +$foo = get_userdatabylogin('bar'); +$foo = is_blog_user(1); + +$foo = 'foo'; +$media = true; + +the_editor($foo, 'bar', 'baz', false); +the_editor($foo, 'bar', 'baz', $media); + +?> +----- +print_extra_script('foo'); + +$foo = get_user_by('email', 'bar'); +$foo = get_user_by('login', 'bar'); +$foo = is_user_member_of_blog(get_current_user_id(), 1); + +$foo = 'foo'; +$media = true; + +wp_editor($foo, 'bar', ['media_buttons' => false]); +wp_editor($foo, 'bar', ['media_buttons' => $media]); + +?> diff --git a/tests/Rector/Sets/Wp34/Wp34Test.php b/tests/Rector/Sets/Wp34/Wp34Test.php new file mode 100644 index 0000000..f22d12a --- /dev/null +++ b/tests/Rector/Sets/Wp34/Wp34Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.4.php'; + } +} diff --git a/tests/Rector/Sets/Wp34/test_fixture.php.inc b/tests/Rector/Sets/Wp34/test_fixture.php.inc new file mode 100644 index 0000000..862a8f8 --- /dev/null +++ b/tests/Rector/Sets/Wp34/test_fixture.php.inc @@ -0,0 +1,34 @@ + +----- + diff --git a/tests/Rector/Sets/Wp35/Wp35Test.php b/tests/Rector/Sets/Wp35/Wp35Test.php new file mode 100644 index 0000000..953f7b8 --- /dev/null +++ b/tests/Rector/Sets/Wp35/Wp35Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.5.php'; + } +} diff --git a/tests/Rector/Sets/Wp35/test_fixture.php.inc b/tests/Rector/Sets/Wp35/test_fixture.php.inc new file mode 100644 index 0000000..ea54c97 --- /dev/null +++ b/tests/Rector/Sets/Wp35/test_fixture.php.inc @@ -0,0 +1,65 @@ +supports_collation(); + +switch_to_blog(1, 'foo'); +wp_create_thumbnail('foo', 1, 'bar'); + +$post = new WP_Post; + +_get_post_ancestors($post); +_insert_into_post_button('foo'); +_media_button('foo', 'bar', 'baz', 'qux'); +_save_post_hook(); +ms_deprecated_blogs_file(); + +wp_get_single_post(1); +get_page(1); + +$foo = new Custom_Background; + +$bar = $foo->attachment_fields_to_edit(['bar']); +$baz = $foo->filter_upload_tabs(['baz']); + +?> +----- +has_cap('collation'); + +switch_to_blog(1); +wp_create_thumbnail('foo', 1); + +$post = new WP_Post; + +get_post(1); +get_post(1); + +$foo = new Custom_Background; + +$bar = ['bar']; +$baz = ['baz']; + +?> diff --git a/tests/Rector/Sets/Wp36/Wp36Test.php b/tests/Rector/Sets/Wp36/Wp36Test.php new file mode 100644 index 0000000..36f7c1d --- /dev/null +++ b/tests/Rector/Sets/Wp36/Wp36Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.6.php'; + } +} diff --git a/tests/Rector/Sets/Wp36/test_fixture.php.inc b/tests/Rector/Sets/Wp36/test_fixture.php.inc new file mode 100644 index 0000000..e937ade --- /dev/null +++ b/tests/Rector/Sets/Wp36/test_fixture.php.inc @@ -0,0 +1,22 @@ +_weak_escape('foo'); +$wpdb->escape('bar'); + +?> +----- + diff --git a/tests/Rector/Sets/Wp37/Wp37Test.php b/tests/Rector/Sets/Wp37/Wp37Test.php new file mode 100644 index 0000000..5a226c2 --- /dev/null +++ b/tests/Rector/Sets/Wp37/Wp37Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.7.php'; + } +} diff --git a/tests/Rector/Sets/Wp37/test_fixture.php.inc b/tests/Rector/Sets/Wp37/test_fixture.php.inc new file mode 100644 index 0000000..121e7ec --- /dev/null +++ b/tests/Rector/Sets/Wp37/test_fixture.php.inc @@ -0,0 +1,12 @@ + +----- + diff --git a/tests/Rector/Sets/Wp38/Wp38Test.php b/tests/Rector/Sets/Wp38/Wp38Test.php new file mode 100644 index 0000000..4db7e35 --- /dev/null +++ b/tests/Rector/Sets/Wp38/Wp38Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.8.php'; + } +} diff --git a/tests/Rector/Sets/Wp38/test_fixture.php.inc b/tests/Rector/Sets/Wp38/test_fixture.php.inc new file mode 100644 index 0000000..2c7c8ec --- /dev/null +++ b/tests/Rector/Sets/Wp38/test_fixture.php.inc @@ -0,0 +1,20 @@ + +----- + diff --git a/tests/Rector/Sets/Wp39/Wp39Test.php b/tests/Rector/Sets/Wp39/Wp39Test.php new file mode 100644 index 0000000..7dbddbd --- /dev/null +++ b/tests/Rector/Sets/Wp39/Wp39Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-3.9.php'; + } +} diff --git a/tests/Rector/Sets/Wp39/test_fixture.php.inc b/tests/Rector/Sets/Wp39/test_fixture.php.inc new file mode 100644 index 0000000..ea6c919 --- /dev/null +++ b/tests/Rector/Sets/Wp39/test_fixture.php.inc @@ -0,0 +1,17 @@ + +----- + diff --git a/tests/Rector/Sets/Wp40/Wp40Test.php b/tests/Rector/Sets/Wp40/Wp40Test.php new file mode 100644 index 0000000..a223a99 --- /dev/null +++ b/tests/Rector/Sets/Wp40/Wp40Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.0.php'; + } +} diff --git a/tests/Rector/Sets/Wp40/test_fixture.php.inc b/tests/Rector/Sets/Wp40/test_fixture.php.inc new file mode 100644 index 0000000..5a59b31 --- /dev/null +++ b/tests/Rector/Sets/Wp40/test_fixture.php.inc @@ -0,0 +1,27 @@ + +----- + 'category', 'fields' => 'ids', 'get' => 'all']); + +define('FORCE_SSL_ADMIN', true); + +if (FORCE_SSL_ADMIN) { + echo 'foo'; +} + +?> diff --git a/tests/Rector/Sets/Wp41/Wp41Test.php b/tests/Rector/Sets/Wp41/Wp41Test.php new file mode 100644 index 0000000..4fb12c2 --- /dev/null +++ b/tests/Rector/Sets/Wp41/Wp41Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.1.php'; + } +} diff --git a/tests/Rector/Sets/Wp41/test_fixture.php.inc b/tests/Rector/Sets/Wp41/test_fixture.php.inc new file mode 100644 index 0000000..1b2c729 --- /dev/null +++ b/tests/Rector/Sets/Wp41/test_fixture.php.inc @@ -0,0 +1,20 @@ +add_tab(); +$foo->prepare_control(); +$foo->print_tab_image(); +$foo->remove_tab(); + +echo 'foo'; + +?> +----- + diff --git a/tests/Rector/Sets/Wp42/Wp42Test.php b/tests/Rector/Sets/Wp42/Wp42Test.php new file mode 100644 index 0000000..7001fbd --- /dev/null +++ b/tests/Rector/Sets/Wp42/Wp42Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.2.php'; + } +} diff --git a/tests/Rector/Sets/Wp42/test_fixture.php.inc b/tests/Rector/Sets/Wp42/test_fixture.php.inc new file mode 100644 index 0000000..335a6c8 --- /dev/null +++ b/tests/Rector/Sets/Wp42/test_fixture.php.inc @@ -0,0 +1,24 @@ +prepreview_added_sidebars_widgets(); +$foo->prepreview_added_widget_instance(); +$foo->remove_prepreview_filters(); +$foo->setup_widget_addition_previews(); + +echo 'bar'; + +?> +----- + diff --git a/tests/Rector/Sets/Wp43/Wp43Test.php b/tests/Rector/Sets/Wp43/Wp43Test.php new file mode 100644 index 0000000..0ff5910 --- /dev/null +++ b/tests/Rector/Sets/Wp43/Wp43Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.3.php'; + } +} diff --git a/tests/Rector/Sets/Wp43/test_fixture.php.inc b/tests/Rector/Sets/Wp43/test_fixture.php.inc new file mode 100644 index 0000000..f1508d4 --- /dev/null +++ b/tests/Rector/Sets/Wp43/test_fixture.php.inc @@ -0,0 +1,29 @@ + +----- + diff --git a/tests/Rector/Sets/Wp44/Wp44Test.php b/tests/Rector/Sets/Wp44/Wp44Test.php new file mode 100644 index 0000000..953d2d7 --- /dev/null +++ b/tests/Rector/Sets/Wp44/Wp44Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.4.php'; + } +} diff --git a/tests/Rector/Sets/Wp44/test_fixture.php.inc b/tests/Rector/Sets/Wp44/test_fixture.php.inc new file mode 100644 index 0000000..85e5eac --- /dev/null +++ b/tests/Rector/Sets/Wp44/test_fixture.php.inc @@ -0,0 +1,31 @@ +flush_widget_cache(); + +?> +----- + diff --git a/tests/Rector/Sets/Wp45/Wp45Test.php b/tests/Rector/Sets/Wp45/Wp45Test.php new file mode 100644 index 0000000..2ca879a --- /dev/null +++ b/tests/Rector/Sets/Wp45/Wp45Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.5.php'; + } +} diff --git a/tests/Rector/Sets/Wp45/test_fixture.php.inc b/tests/Rector/Sets/Wp45/test_fixture.php.inc new file mode 100644 index 0000000..5c2b1ae --- /dev/null +++ b/tests/Rector/Sets/Wp45/test_fixture.php.inc @@ -0,0 +1,42 @@ +is_comments_popup()) { + echo 'bar'; +} + +$foo = $query->lazyload_comment_meta('foo', 1); +$bar = $query->lazyload_term_meta('bar', 1); + +?> +----- + diff --git a/tests/Rector/Sets/Wp46/Wp46Test.php b/tests/Rector/Sets/Wp46/Wp46Test.php new file mode 100644 index 0000000..2f3ea58 --- /dev/null +++ b/tests/Rector/Sets/Wp46/Wp46Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.6.php'; + } +} diff --git a/tests/Rector/Sets/Wp46/test_fixture.php.inc b/tests/Rector/Sets/Wp46/test_fixture.php.inc new file mode 100644 index 0000000..598f00e --- /dev/null +++ b/tests/Rector/Sets/Wp46/test_fixture.php.inc @@ -0,0 +1,15 @@ + +----- + diff --git a/tests/Rector/Sets/Wp47/Wp47Test.php b/tests/Rector/Sets/Wp47/Wp47Test.php new file mode 100644 index 0000000..a3247ee --- /dev/null +++ b/tests/Rector/Sets/Wp47/Wp47Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.7.php'; + } +} diff --git a/tests/Rector/Sets/Wp47/test_fixture.php.inc b/tests/Rector/Sets/Wp47/test_fixture.php.inc new file mode 100644 index 0000000..e1e8ba8 --- /dev/null +++ b/tests/Rector/Sets/Wp47/test_fixture.php.inc @@ -0,0 +1,44 @@ +reinit(); + +$baz = new WP_Roles; +$baz->reinit(); + +add_filter('blog_details', '__return_empty_array'); + +$class = new WP_Customize_Manager; + +$class->customize_preview_base(); +$class->customize_preview_html5(); +$class->customize_preview_override_404_status(); +$class->customize_preview_signature(); +$foo = $class->remove_preview_signature('bar'); + +?> +----- +for_site(); + +$baz = new WP_Roles; +$baz->for_site(); + +add_filter('site_details', '__return_empty_array'); + +$class = new WP_Customize_Manager; +$foo = 'bar'; + +?> diff --git a/tests/Rector/Sets/Wp48/Wp48Test.php b/tests/Rector/Sets/Wp48/Wp48Test.php new file mode 100644 index 0000000..46accbc --- /dev/null +++ b/tests/Rector/Sets/Wp48/Wp48Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.8.php'; + } +} diff --git a/tests/Rector/Sets/Wp48/test_fixture.php.inc b/tests/Rector/Sets/Wp48/test_fixture.php.inc new file mode 100644 index 0000000..3b3cbdf --- /dev/null +++ b/tests/Rector/Sets/Wp48/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp49/Wp49Test.php b/tests/Rector/Sets/Wp49/Wp49Test.php new file mode 100644 index 0000000..1119236 --- /dev/null +++ b/tests/Rector/Sets/Wp49/Wp49Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-4.9.php'; + } +} diff --git a/tests/Rector/Sets/Wp49/test_fixture.php.inc b/tests/Rector/Sets/Wp49/test_fixture.php.inc new file mode 100644 index 0000000..017e751 --- /dev/null +++ b/tests/Rector/Sets/Wp49/test_fixture.php.inc @@ -0,0 +1,25 @@ +for_blog(1); +(new WP_User)->for_blog(2); + +?> +----- +for_site(1); +(new WP_User)->for_site(2); + +?> diff --git a/tests/Rector/Sets/Wp50/Wp50Test.php b/tests/Rector/Sets/Wp50/Wp50Test.php new file mode 100644 index 0000000..f92f2ae --- /dev/null +++ b/tests/Rector/Sets/Wp50/Wp50Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.0.php'; + } +} diff --git a/tests/Rector/Sets/Wp50/test_fixture.php.inc b/tests/Rector/Sets/Wp50/test_fixture.php.inc new file mode 100644 index 0000000..a94bb3a --- /dev/null +++ b/tests/Rector/Sets/Wp50/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp51/Wp51Test.php b/tests/Rector/Sets/Wp51/Wp51Test.php new file mode 100644 index 0000000..c8d0d9a --- /dev/null +++ b/tests/Rector/Sets/Wp51/Wp51Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.1.php'; + } +} diff --git a/tests/Rector/Sets/Wp51/test_fixture.php.inc b/tests/Rector/Sets/Wp51/test_fixture.php.inc new file mode 100644 index 0000000..5d81016 --- /dev/null +++ b/tests/Rector/Sets/Wp51/test_fixture.php.inc @@ -0,0 +1,12 @@ + +----- + diff --git a/tests/Rector/Sets/Wp52/Wp52Test.php b/tests/Rector/Sets/Wp52/Wp52Test.php new file mode 100644 index 0000000..f1cda76 --- /dev/null +++ b/tests/Rector/Sets/Wp52/Wp52Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.2.php'; + } +} diff --git a/tests/Rector/Sets/Wp52/test_fixture.php.inc b/tests/Rector/Sets/Wp52/test_fixture.php.inc new file mode 100644 index 0000000..adeb875 --- /dev/null +++ b/tests/Rector/Sets/Wp52/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp53/Wp53Test.php b/tests/Rector/Sets/Wp53/Wp53Test.php new file mode 100644 index 0000000..ed69b9a --- /dev/null +++ b/tests/Rector/Sets/Wp53/Wp53Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.3.php'; + } +} diff --git a/tests/Rector/Sets/Wp53/test_fixture.php.inc b/tests/Rector/Sets/Wp53/test_fixture.php.inc new file mode 100644 index 0000000..28157a8 --- /dev/null +++ b/tests/Rector/Sets/Wp53/test_fixture.php.inc @@ -0,0 +1,16 @@ + +----- + diff --git a/tests/Rector/Sets/Wp54/Wp54Test.php b/tests/Rector/Sets/Wp54/Wp54Test.php new file mode 100644 index 0000000..97bf7c1 --- /dev/null +++ b/tests/Rector/Sets/Wp54/Wp54Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.4.php'; + } +} diff --git a/tests/Rector/Sets/Wp54/test_fixture.php.inc b/tests/Rector/Sets/Wp54/test_fixture.php.inc new file mode 100644 index 0000000..c8d98e6 --- /dev/null +++ b/tests/Rector/Sets/Wp54/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp55/Wp55Test.php b/tests/Rector/Sets/Wp55/Wp55Test.php new file mode 100644 index 0000000..16a0c7b --- /dev/null +++ b/tests/Rector/Sets/Wp55/Wp55Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.5.php'; + } +} diff --git a/tests/Rector/Sets/Wp55/test_fixture.php.inc b/tests/Rector/Sets/Wp55/test_fixture.php.inc new file mode 100644 index 0000000..84430be --- /dev/null +++ b/tests/Rector/Sets/Wp55/test_fixture.php.inc @@ -0,0 +1,31 @@ + +----- + diff --git a/tests/Rector/Sets/Wp56/Wp56Test.php b/tests/Rector/Sets/Wp56/Wp56Test.php new file mode 100644 index 0000000..e4a06ff --- /dev/null +++ b/tests/Rector/Sets/Wp56/Wp56Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.6.php'; + } +} diff --git a/tests/Rector/Sets/Wp56/test_fixture.php.inc b/tests/Rector/Sets/Wp56/test_fixture.php.inc new file mode 100644 index 0000000..63022f3 --- /dev/null +++ b/tests/Rector/Sets/Wp56/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp57/Wp57Test.php b/tests/Rector/Sets/Wp57/Wp57Test.php new file mode 100644 index 0000000..98d60ff --- /dev/null +++ b/tests/Rector/Sets/Wp57/Wp57Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.7.php'; + } +} diff --git a/tests/Rector/Sets/Wp57/test_fixture.php.inc b/tests/Rector/Sets/Wp57/test_fixture.php.inc new file mode 100644 index 0000000..32aee40 --- /dev/null +++ b/tests/Rector/Sets/Wp57/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp58/Wp58Test.php b/tests/Rector/Sets/Wp58/Wp58Test.php new file mode 100644 index 0000000..b048b2d --- /dev/null +++ b/tests/Rector/Sets/Wp58/Wp58Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.8.php'; + } +} diff --git a/tests/Rector/Sets/Wp58/test_fixture.php.inc b/tests/Rector/Sets/Wp58/test_fixture.php.inc new file mode 100644 index 0000000..b1fcabd --- /dev/null +++ b/tests/Rector/Sets/Wp58/test_fixture.php.inc @@ -0,0 +1,19 @@ + +----- + diff --git a/tests/Rector/Sets/Wp59/Wp59Test.php b/tests/Rector/Sets/Wp59/Wp59Test.php new file mode 100644 index 0000000..cbf609c --- /dev/null +++ b/tests/Rector/Sets/Wp59/Wp59Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-5.9.php'; + } +} diff --git a/tests/Rector/Sets/Wp59/test_fixture.php.inc b/tests/Rector/Sets/Wp59/test_fixture.php.inc new file mode 100644 index 0000000..1ad9aa5 --- /dev/null +++ b/tests/Rector/Sets/Wp59/test_fixture.php.inc @@ -0,0 +1,17 @@ + +----- + diff --git a/tests/Rector/Sets/Wp60/Wp60Test.php b/tests/Rector/Sets/Wp60/Wp60Test.php new file mode 100644 index 0000000..9a09530 --- /dev/null +++ b/tests/Rector/Sets/Wp60/Wp60Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-6.0.php'; + } +} diff --git a/tests/Rector/Sets/Wp60/test_fixture.php.inc b/tests/Rector/Sets/Wp60/test_fixture.php.inc new file mode 100644 index 0000000..7969b14 --- /dev/null +++ b/tests/Rector/Sets/Wp60/test_fixture.php.inc @@ -0,0 +1,13 @@ + +----- + diff --git a/tests/Rector/Sets/Wp61/Wp61Test.php b/tests/Rector/Sets/Wp61/Wp61Test.php new file mode 100644 index 0000000..9000720 --- /dev/null +++ b/tests/Rector/Sets/Wp61/Wp61Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-6.1.php'; + } +} diff --git a/tests/Rector/Sets/Wp61/test_fixture.php.inc b/tests/Rector/Sets/Wp61/test_fixture.php.inc new file mode 100644 index 0000000..c608155 --- /dev/null +++ b/tests/Rector/Sets/Wp61/test_fixture.php.inc @@ -0,0 +1,37 @@ + +----- + diff --git a/tests/Rector/Sets/Wp62/Wp62Test.php b/tests/Rector/Sets/Wp62/Wp62Test.php new file mode 100644 index 0000000..7ded5c4 --- /dev/null +++ b/tests/Rector/Sets/Wp62/Wp62Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-6.2.php'; + } +} diff --git a/tests/Rector/Sets/Wp62/test_fixture.php.inc b/tests/Rector/Sets/Wp62/test_fixture.php.inc new file mode 100644 index 0000000..abbbd23 --- /dev/null +++ b/tests/Rector/Sets/Wp62/test_fixture.php.inc @@ -0,0 +1,11 @@ + +----- + diff --git a/tests/Rector/Sets/Wp63/Wp63Test.php b/tests/Rector/Sets/Wp63/Wp63Test.php new file mode 100644 index 0000000..b8219c8 --- /dev/null +++ b/tests/Rector/Sets/Wp63/Wp63Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-6.3.php'; + } +} diff --git a/tests/Rector/Sets/Wp63/test_fixture.php.inc b/tests/Rector/Sets/Wp63/test_fixture.php.inc new file mode 100644 index 0000000..f8ed78f --- /dev/null +++ b/tests/Rector/Sets/Wp63/test_fixture.php.inc @@ -0,0 +1,36 @@ +lazyload_comment_meta('foo'); +$class->lazyload_term_meta('foo'); +$wp_query = new WP_Query; + +$bar = ['bar']; + +$wp_query->lazyload_comment_meta('foo', 1); +$wp_query->lazyload_term_meta('foo', 1); + +block_core_navigation_submenu_build_css_colors(['foo'], ['bar'], false); +wlwmanifest_link(); +wp_img_tag_add_loading_attr('foo', 'bar'); + +?> +----- +lazyload_meta_callback('foo', 0, '', false, 'comment'); +$class->lazyload_meta_callback('foo', 0, '', false, 'term'); +$wp_query = new WP_Query; + +$bar = ['bar']; + +$wp_query->lazyload_comment_meta('foo', 1); +$wp_query->lazyload_term_meta('foo', 1); + +block_core_navigation_link_build_css_colors(['foo'], ['bar'], false); +wp_img_tag_add_loading_optimization_attrs('foo', 'bar'); + +?> diff --git a/tests/Rector/Sets/Wp64/Wp64Test.php b/tests/Rector/Sets/Wp64/Wp64Test.php new file mode 100644 index 0000000..2635b01 --- /dev/null +++ b/tests/Rector/Sets/Wp64/Wp64Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/../../../../config/sets/wp-6.4.php'; + } +} diff --git a/tests/Rector/Sets/Wp64/test_fixture.php.inc b/tests/Rector/Sets/Wp64/test_fixture.php.inc new file mode 100644 index 0000000..9f75af4 --- /dev/null +++ b/tests/Rector/Sets/Wp64/test_fixture.php.inc @@ -0,0 +1,25 @@ + +----- +