Skip to content

Apply fixes from StyleCI #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/leetcode/LargestNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function largestNumber2(array $nums): string
return '';
}
usort($nums, static function ($a, $b) {
return -(($a.$b) <=> ($b.$a));
return -(($a . $b) <=> ($b . $a));
});
if ((int)$nums[0] === 0) {
return '0';
Expand All @@ -42,6 +42,6 @@ public static function largestNumber2(array $nums): string

private static function compare(int $a, int $b): int
{
return ($a.$b) <=> ($b.$a);
return ($a . $b) <=> ($b . $a);
}
}
9 changes: 6 additions & 3 deletions tests/leetcode/InvertBinaryTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ class InvertBinaryTreeTest extends TestCase

protected function setUp(): void
{
$node1 = new TreeNode(4,
new TreeNode(2,
$node1 = new TreeNode(
4,
new TreeNode(
2,
new TreeNode(1),
new TreeNode(3)
),
new TreeNode(7,
new TreeNode(
7,
new TreeNode(6),
new TreeNode(9)
)
Expand Down