Skip to content

Commit 01aa16c

Browse files
committed
Fix for array_sort.
1 parent 83635cb commit 01aa16c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/Coroutine/Connectors/MySqlConnector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace SwooleTW\Http\Coroutine\Connectors;
44

5+
56
use Illuminate\Database\Connectors\MySqlConnector as BaseConnector;
67
use Illuminate\Support\Str;
78
use SwooleTW\Http\Coroutine\PDO as SwoolePDO;

src/HotReload/FSEventParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static function toEvent(string $event): ?FSEvent
2626
$date = Carbon::parse($matches[static::DATE]);
2727
$path = $matches[static::PATH];
2828
$events = explode(' ', $matches[static::EVENTS]);
29-
$events = array_sort(array_intersect(FSEvent::getPossibleTypes(), $events));
29+
$events = array_sort(array_intersect(FSEvent::getPossibleTypes(), $events), SORT_ASC);
3030

3131
return new FSEvent($date, $path, $events);
3232
}

tests/HotReload/FSEventTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testObjectIsCorrect()
1616
$date = Carbon::parse('Mon Dec 31 01:18:34 2018');
1717
$path = '/Some/Path/To/File/File.php';
1818
$events = explode(' ', 'Renamed OwnerModified IsFile');
19-
$events = array_sort(array_intersect(FSEvent::getPossibleTypes(), $events));
19+
$events = array_sort(array_intersect(FSEvent::getPossibleTypes(), $events), SORT_ASC);
2020
$event = new FSEvent($date, $path, $events);
2121

2222
$this->assertTrue(array_diff($event->getTypes(), [FSEvent::Renamed, FSEvent::OwnerModified]) === []);

0 commit comments

Comments
 (0)