Skip to content

Commit a44eded

Browse files
authored
Merge pull request #7 from kitloong/feature/type
Add return type
2 parents 824a783 + 6a3f03d commit a44eded

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

src/HttpLog/LogWriter.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ public function log(Request $request, string $uniqId): void
1616
Log::channel(config('app-logger.http.channel'))->info($message);
1717
}
1818

19+
/**
20+
* @return array{
21+
* uniqid: string,
22+
* method: string,
23+
* uri: string,
24+
* body: array<string, mixed>,
25+
* headers: array<string, array<string>>,
26+
* files: array<string>
27+
* }
28+
*/
1929
protected function getMessages(Request $request, string $uniqId): array
2030
{
2131
$files = (new Collection(iterator_to_array($request->files)))

src/PerformanceLog/LogWriter.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ public function log(Request $request, $response, string $uniqId): void
3737
}
3838

3939
/**
40-
* @param \Illuminate\Http\Request $request
41-
* @param \Illuminate\Http\Response $response
42-
* @param string $uniqId
43-
* @return array
40+
* @return array{
41+
* uniqid: string,
42+
* method: string,
43+
* uri: string,
44+
* status: int,
45+
* time: string,
46+
* memory: string
47+
* }
4448
*/
4549
protected function getMessages(Request $request, $response, string $uniqId): array
4650
{

src/QueryLog/LogWriter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ public function log(): void
1717
});
1818
}
1919

20+
/**
21+
* @return array{
22+
* time: float,
23+
* connection_name: string,
24+
* sql: string
25+
* }
26+
*/
2027
protected function getMessages(QueryExecuted $query): array
2128
{
2229
$sql = $query->sql;

0 commit comments

Comments
 (0)