Skip to content

Commit baabf9b

Browse files
swissspidyclaude
andcommitted
Put array items on their own lines in the new recurse-keys scenarios
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 002673e commit baabf9b

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

‎features/search-replace.feature‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,13 @@ Feature: Do global search/replace
18381838
"""
18391839
<?php
18401840
$replacer = new \WP_CLI\SearchReplacer( 'old', 'new', true, false, '', '/', false, -1, true );
1841-
echo $replacer->run( serialize( array( 8 => 'v1', '08' => 'v2', 'old' => 'v3' ) ) ), "\n";
1842-
echo $replacer->run( serialize( (object) array( 8 => 'v1', '08' => 'v2', 'old' => 'v3' ) ) ), "\n";
1841+
$data = array(
1842+
8 => 'v1',
1843+
'08' => 'v2',
1844+
'old' => 'v3',
1845+
);
1846+
echo $replacer->run( serialize( $data ) ), "\n";
1847+
echo $replacer->run( serialize( (object) $data ) ), "\n";
18431848
"""
18441849

18451850
When I run `wp eval-file recurse-keys-storage-identity.php`
@@ -1863,7 +1868,11 @@ Feature: Do global search/replace
18631868
"""
18641869
<?php
18651870
$replacer = new \WP_CLI\SearchReplacer( 'old', 'newold', true, false, '', '/', false, -1, true );
1866-
$result = unserialize( $replacer->run( serialize( (object) array( 'old' => 'v1', 'newold' => 'v2' ) ) ) );
1871+
$data = array(
1872+
'old' => 'v1',
1873+
'newold' => 'v2',
1874+
);
1875+
$result = unserialize( $replacer->run( serialize( (object) $data ) ) );
18671876
echo json_encode( $result );
18681877
"""
18691878

@@ -1894,7 +1903,14 @@ Feature: Do global search/replace
18941903
$replacer = new \WP_CLI\SearchReplacer( 'old', 'NEW', true, false, '', '/', false, -1, true );
18951904
$result = unserialize(
18961905
$replacer->run(
1897-
serialize( new \WpOrg\Requests\Utility\CaseInsensitiveDictionary( [ 'old' => 'v1', 'new' => 'v2' ] ) )
1906+
serialize(
1907+
new \WpOrg\Requests\Utility\CaseInsensitiveDictionary(
1908+
[
1909+
'old' => 'v1',
1910+
'new' => 'v2',
1911+
]
1912+
)
1913+
)
18981914
),
18991915
[ 'allowed_classes' => [ 'WpOrg\Requests\Utility\CaseInsensitiveDictionary' ] ]
19001916
);

0 commit comments

Comments
 (0)