Skip to content

Commit

Permalink
fixed PHP Deprecated: Use of "self" in callables is deprecated (sspoo…
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik authored and sspooky13 committed Apr 23, 2024
1 parent 4d2fdb3 commit 7586a9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
### Removed
- [#69][#75] dropped support PHP 7.1 and dropped support Symfony 4.1 and lower

### Fixed
- [#80] fixed PHP Deprecated: Use of "self" in callables is deprecated, Thanks to [@TomasLudvik]

## [8.1.1]
### Fixed
- [#83] fixed application when using sebastian/diff version 5 (set Builder class for Differ class)
Expand Down Expand Up @@ -257,13 +260,15 @@ 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

[#83]: https://github.com/sspooky13/yaml-standards/issues/83
[#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
Expand Down
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 7586a9d

Please sign in to comment.