diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f1bcb..cbd6e78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Fixed - fixed application when using sebastian/diff version 5 (set Builder class for Differ class) +- [#80] fixed PHP Deprecated: Use of "self" in callables is deprecated, Thanks to [@TomasLudvik] ## [8.1.0] ### Added @@ -256,12 +257,14 @@ patchesJson6902: - create base command to check yaml sort - create `--diff` mode +[@TomasLudvik]: https://github.com/TomasLudvik [@techi602]: https://github.com/techi602 [@ChrisDBrown]: https://github.com/ChrisDBrown [@boris-brtan]: https://github.com/boris-brtan [@DavidOstrozlik]: https://github.com/DavidOstrozlik [@PetrHeinz]: https://github.com/PetrHeinz +[#80]: https://github.com/sspooky13/yaml-standards/pull/80 [#79]: https://github.com/sspooky13/yaml-standards/pull/79 [#78]: https://github.com/sspooky13/yaml-standards/pull/78 [#77]: https://github.com/sspooky13/yaml-standards/issues/77 diff --git a/src/Model/YamlAlphabetical/YamlSortService.php b/src/Model/YamlAlphabetical/YamlSortService.php index e822a77..1a4ce23 100644 --- a/src/Model/YamlAlphabetical/YamlSortService.php +++ b/src/Model/YamlAlphabetical/YamlSortService.php @@ -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); diff --git a/src/Model/YamlInline/YamlInlineChecker.php b/src/Model/YamlInline/YamlInlineChecker.php index 9523cf4..dcff2c8 100644 --- a/src/Model/YamlInline/YamlInlineChecker.php +++ b/src/Model/YamlInline/YamlInlineChecker.php @@ -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[] = ''; }