1 | <?php |
||
9 | class ClientFactory |
||
10 | { |
||
11 | /** |
||
12 | * The number of minutes to cache the client. |
||
13 | * |
||
14 | * @var int |
||
15 | */ |
||
16 | const CACHE_MINUTES = 20; |
||
17 | |||
18 | /** |
||
19 | * The app instance. |
||
20 | * |
||
21 | * @var \Illuminate\Contracts\Container\Container |
||
22 | */ |
||
23 | protected $app; |
||
24 | |||
25 | /** |
||
26 | * The cache repository instance. |
||
27 | * |
||
28 | * @var \Illuminate\Contracts\Cache\Repository |
||
29 | */ |
||
30 | protected $cache; |
||
31 | |||
32 | /** |
||
33 | * Create a new factory instance. |
||
34 | * |
||
35 | * @param \Illuminate\Contracts\Container\Container $app |
||
36 | * @param \Illuminate\Contracts\Cache\Repository $cache |
||
37 | * @return void |
||
|
|||
38 | */ |
||
39 | public function __construct(Container $app, Repository $cache) |
||
44 | |||
45 | /** |
||
46 | * Get an instance of the Pushok client, holding on to each in the cache for the given length of time. |
||
47 | * |
||
48 | * @return \Pushok\Client |
||
49 | */ |
||
50 | public function instance(): Client |
||
56 | } |
||
57 |
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.