diff --git a/config/sets/level/up-to-wp-6.5.php b/config/sets/level/up-to-wp-6.5.php new file mode 100644 index 0000000..04d564f --- /dev/null +++ b/config/sets/level/up-to-wp-6.5.php @@ -0,0 +1,9 @@ +sets([WordPressSetList::WP_6_5, WordPressLevelSetList::UP_TO_WP_6_4]); +}; diff --git a/config/sets/wp-6.5.php b/config/sets/wp-6.5.php new file mode 100644 index 0000000..d2dd090 --- /dev/null +++ b/config/sets/wp-6.5.php @@ -0,0 +1,33 @@ +import(__DIR__ . '/../config.php'); + + $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ + new MethodParameterAdder('Custom_Image_Header', 'create_attachment_object', 2, 'custom-header'), + new MethodParameterAdder('WP_Site_Icon', 'create_attachment_object', 2, 'site-icon'), + ]); + + $rectorConfig->ruleWithConfiguration(MethodCallToFuncCallRector::class, [ + new MethodCallToFuncCall('Custom_Image_Header', 'create_attachment_object', 'wp_copy_parent_attachment_properties'), + new MethodCallToFuncCall('WP_Site_Icon', 'create_attachment_object', 'wp_copy_parent_attachment_properties'), + ]); + + /* + * TODO: these are not handled currently + * + * FUNCTIONS + * - block_core_query_ensure_interactivity_dependency + * - block_core_file_ensure_interactivity_dependency + * - block_core_image_ensure_interactivity_dependency + * + * METHODS + * - Translations::parenthesize_plural_exression + */ +}; diff --git a/src/Set/WordPressLevelSetList.php b/src/Set/WordPressLevelSetList.php index 377cd41..48955ea 100644 --- a/src/Set/WordPressLevelSetList.php +++ b/src/Set/WordPressLevelSetList.php @@ -101,4 +101,6 @@ final class WordPressLevelSetList implements SetListInterface public const UP_TO_WP_6_3 = __DIR__ . '/../../config/sets/level/up-to-wp-6.3.php'; public const UP_TO_WP_6_4 = __DIR__ . '/../../config/sets/level/up-to-wp-6.4.php'; + + public const UP_TO_WP_6_5 = __DIR__ . '/../../config/sets/level/up-to-wp-6.5.php'; } diff --git a/src/Set/WordPressSetList.php b/src/Set/WordPressSetList.php index 17cad6d..19c0e56 100644 --- a/src/Set/WordPressSetList.php +++ b/src/Set/WordPressSetList.php @@ -101,4 +101,6 @@ final class WordPressSetList implements SetListInterface public const WP_6_3 = __DIR__ . '/../../config/sets/wp-6.3.php'; public const WP_6_4 = __DIR__ . '/../../config/sets/wp-6.4.php'; + + public const WP_6_5 = __DIR__ . '/../../config/sets/wp-6.5.php'; } diff --git a/tests/Rector/Sets/Level/UpToWp64/UpToWp64Test.php b/tests/Rector/Sets/Level/UpToWp65/UpToWp65Test.php similarity index 88% rename from tests/Rector/Sets/Level/UpToWp64/UpToWp64Test.php rename to tests/Rector/Sets/Level/UpToWp65/UpToWp65Test.php index 6fda14a..c36f348 100644 --- a/tests/Rector/Sets/Level/UpToWp64/UpToWp64Test.php +++ b/tests/Rector/Sets/Level/UpToWp65/UpToWp65Test.php @@ -1,6 +1,6 @@ create_attachment_object('foo', 1); +$class2->create_attachment_object('foo', 1); + ?> ----- diff --git a/tests/Rector/Sets/Wp65/Wp65Test.php b/tests/Rector/Sets/Wp65/Wp65Test.php new file mode 100644 index 0000000..c4acfde --- /dev/null +++ b/tests/Rector/Sets/Wp65/Wp65Test.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.5.php'; + } +} diff --git a/tests/Rector/Sets/Wp65/test_fixture.php.inc b/tests/Rector/Sets/Wp65/test_fixture.php.inc new file mode 100644 index 0000000..e6ceefd --- /dev/null +++ b/tests/Rector/Sets/Wp65/test_fixture.php.inc @@ -0,0 +1,19 @@ +create_attachment_object('foo', 1); +$class2->create_attachment_object('foo', 1); + +?> +----- +