1 | <?php |
||
10 | class ClientFactory |
||
11 | { |
||
12 | /** |
||
13 | * The number of minutes to cache the client. |
||
14 | * |
||
15 | * @var int |
||
16 | */ |
||
17 | const CACHE_MINUTES = 20; |
||
18 | |||
19 | /** |
||
20 | * The app instance. |
||
21 | * |
||
22 | * @var \Illuminate\Contracts\Container\Container |
||
23 | */ |
||
24 | protected $app; |
||
25 | |||
26 | /** |
||
27 | * The cache repository instance. |
||
28 | * |
||
29 | * @var \Illuminate\Contracts\Cache\Repository |
||
30 | */ |
||
31 | protected $cache; |
||
32 | |||
33 | /** |
||
34 | * Create a new factory instance. |
||
35 | * |
||
36 | * @param \Illuminate\Contracts\Container\Container $app |
||
37 | * @param \Illuminate\Contracts\Cache\Repository $cache |
||
38 | * @return void |
||
|
|||
39 | */ |
||
40 | 1 | public function __construct(Container $app, Repository $cache) |
|
45 | |||
46 | /** |
||
47 | * Get an instance of the Pushok client, holding on to each in the cache for the given length of time. |
||
48 | * |
||
49 | * @return \Pushok\Client |
||
50 | */ |
||
51 | 1 | public function instance(): Client |
|
57 | } |
||
58 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.