Skip to content

Commit 1365386

Browse files
committed
Refactor
1 parent 47f114d commit 1365386

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Magento2/Sniffs/Functions/FunctionsDeprecatedWithoutArgumentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FunctionsDeprecatedWithoutArgumentSniff implements Sniff
3636
* @var array
3737
*/
3838
private const DEPRECATED_FUNCTIONS_AND_FIXES = [
39-
'mb_check_encoding' => '\'\'',
39+
'mb_check_encoding' => '[]',
4040
'get_class' => '$this',
4141
'get_parent_class' => '$this'
4242
];

Magento2/Tests/Functions/FunctionsDeprecatedWithoutArgumentUnitTest.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class FunctionsDeprecatedWithoutArgument
2121
{
2222
return [
2323
mb_check_encoding(), // Calling without argument is deprecated.
24-
mb_check_encoding('test-argument', null),
24+
mb_check_encoding('test-argument'),
2525
get_class(), // Calling without argument is deprecated.
2626
get_class(new FunctionsDeprecatedWithoutArgument()),
2727
get_parent_class(), // Calling without argument is deprecated.
28-
get_parent_class('test-argument')
28+
get_parent_class(new FunctionsDeprecatedWithoutArgument())
2929
];
3030
}
3131
}

Magento2/Tests/Functions/FunctionsDeprecatedWithoutArgumentUnitTest.inc.fixed

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class FunctionsDeprecatedWithoutArgument
2020
public function testDeprecatedMethod(): array
2121
{
2222
return [
23-
mb_check_encoding(''), // Calling without argument is deprecated.
24-
mb_check_encoding('test-argument', null),
23+
mb_check_encoding([]), // Calling without argument is deprecated.
24+
mb_check_encoding('test-argument'),
2525
get_class($this), // Calling without argument is deprecated.
2626
get_class(new FunctionsDeprecatedWithoutArgument()),
2727
get_parent_class($this), // Calling without argument is deprecated.
28-
get_parent_class('test-argument')
28+
get_parent_class(new FunctionsDeprecatedWithoutArgument())
2929
];
3030
}
3131
}

0 commit comments

Comments
 (0)