Skip to content

Commit ca354f7

Browse files
authored
Add php doc comments for ServerTiming facade
Add php doc comments for each public function for the facade, so that there is help text along with IDE intellisense to know about that static functions it supports.
1 parent cf0ef01 commit ca354f7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Facades/ServerTiming.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,26 @@
44

55
use Illuminate\Support\Facades\Facade;
66

7+
/**
8+
* @method static \BeyondCode\ServerTiming\ServerTiming start(string $key) Start a unique timed event.
9+
* @method static \BeyondCode\ServerTiming\ServerTiming addMetric(string $metric) Add new event with null duration.
10+
* @method static bool hasStartedEvent(string $key) Check if a event has been created already.
11+
* @method static \BeyondCode\ServerTiming\ServerTiming measure(string $key) Stop existing event and record its duration, else start a new event.
12+
* @method static \BeyondCode\ServerTiming\ServerTiming stop(string $key) Stop a timed event and record its duration.
13+
* @method static void stopAllUnfinishedEvents() Stop all running events.
14+
* @method static \BeyondCode\ServerTiming\ServerTiming setDuration(string $key, float|int|callable $duration) Set the duration for an event if $duration is number, else record elapsed time to run a user function if $duration is callable.
15+
* @method static float|int|null getDuration(string $key) Retrieve the duration an event has taken.
16+
* @method static array events() Get the list of finished events with their associated duration.
17+
*
18+
* @see \BeyondCode\ServerTiming\ServerTiming
19+
*/
720
class ServerTiming extends Facade
821
{
22+
/**
23+
* Get the registered name of the component.
24+
*
25+
* @return string
26+
*/
927
protected static function getFacadeAccessor()
1028
{
1129
return \BeyondCode\ServerTiming\ServerTiming::class;

0 commit comments

Comments
 (0)