1 | <?php |
||
35 | class VerifyTicket |
||
36 | { |
||
37 | use Caches; |
||
38 | |||
39 | /** |
||
40 | * App Id. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $appId; |
||
45 | |||
46 | /** |
||
47 | * Cache Key. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $cacheKey; |
||
52 | |||
53 | /** |
||
54 | * Component verify ticket xml structure name. |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $ticketXmlName = 'ComponentVerifyTicket'; |
||
59 | |||
60 | /** |
||
61 | * Cache key prefix. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $prefix = 'easywechat.open_platform.component_verify_ticket.'; |
||
66 | |||
67 | /** |
||
68 | * VerifyTicket constructor. |
||
69 | * |
||
70 | * @param string $appId |
||
71 | * @param Cache $cache |
||
72 | */ |
||
73 | public function __construct($appId, Cache $cache = null) |
||
78 | |||
79 | /** |
||
80 | * Save component verify ticket. |
||
81 | * |
||
82 | * @param Collection $message |
||
83 | * |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function cache(Collection $message) |
||
93 | |||
94 | /** |
||
95 | * Get component verify ticket. |
||
96 | * |
||
97 | * @return string |
||
98 | * |
||
99 | * @throws RuntimeException |
||
100 | */ |
||
101 | public function getTicket() |
||
109 | |||
110 | /** |
||
111 | * Set component verify ticket cache key. |
||
112 | * |
||
113 | * @param string $cacheKey |
||
114 | * |
||
115 | * @return $this |
||
116 | */ |
||
117 | public function setCacheKey($cacheKey) |
||
123 | |||
124 | /** |
||
125 | * Get component verify ticket cache key. |
||
126 | * |
||
127 | * @return string $this->cacheKey |
||
128 | */ |
||
129 | public function getCacheKey() |
||
137 | } |
||
138 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):