Skip to content

Commit

Permalink
fixed PHP Deprecated: Use of "self" in callables is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik committed Mar 25, 2024
1 parent d9f0f58 commit 45b7eac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Model/YamlAlphabetical/YamlSortService.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ private static function sortArrayKeyWithUnderscoresAsFirst(array $yamlArrayData,
$arrayWithUnderscoreKeys = array_filter($yamlArrayData, [YamlService::class, 'hasArrayKeyUnderscoreAsFirstCharacter'], ARRAY_FILTER_USE_KEY);
$arrayWithOtherKeys = array_filter($yamlArrayData, [YamlService::class, 'hasNotArrayKeyUnderscoreAsFirstCharacter'], ARRAY_FILTER_USE_KEY);

uksort($arrayWithUnderscoreKeys, ['self', 'sortArrayAlphabetical']);
uksort($arrayWithOtherKeys, ['self', 'sortArrayAlphabetical']);
uksort($arrayWithUnderscoreKeys, [__CLASS__, 'sortArrayAlphabetical']);
uksort($arrayWithOtherKeys, [__CLASS__, 'sortArrayAlphabetical']);

$arrayData = array_merge($arrayWithUnderscoreKeys, $arrayWithOtherKeys);

Expand Down
4 changes: 2 additions & 2 deletions src/Model/YamlInline/YamlInlineChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function check(string $pathToFile, StandardParametersData $standardParame
$yamlLines = explode("\n", $yamlContent);
$lastYamlElement = end($yamlLines);
$filteredYamlLines = array_filter($yamlLines, [YamlService::class, 'isLineNotBlank']);
$filteredYamlLines = array_filter($filteredYamlLines, ['self', 'removeCommentLine']);
$filteredYamlLines = array_map(['self', 'removeComments'], $filteredYamlLines);
$filteredYamlLines = array_filter($filteredYamlLines, [__CLASS__, 'removeCommentLine']);
$filteredYamlLines = array_map([__CLASS__, 'removeComments'], $filteredYamlLines);
if (YamlService::isLineBlank($lastYamlElement)) {
$filteredYamlLines[] = '';
}
Expand Down

0 comments on commit 45b7eac

Please sign in to comment.