1 | <?php |
||
2 | /** |
||
3 | * Created by PhpStorm. |
||
4 | * User: hugh.li |
||
5 | * Date: 2022/2/24 |
||
6 | * Time: 17:35 |
||
7 | */ |
||
8 | |||
9 | namespace HughCube\Laravel\WeChat\Message\Event; |
||
10 | |||
11 | use HughCube\Laravel\WeChat\Contracts\Message\Event\UserEventMenuClickMiniProgram as Contract; |
||
12 | use Illuminate\Support\Str; |
||
13 | |||
14 | class UserEventMenuClickMiniProgram extends Event implements Contract |
||
15 | { |
||
16 | public function getPage(): string |
||
17 | { |
||
18 | return $this->getEventKey(); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
19 | } |
||
20 | |||
21 | public function getMenuId(): string |
||
22 | { |
||
23 | return $this->getMessage('MenuId'); |
||
0 ignored issues
–
show
|
|||
24 | } |
||
25 | |||
26 | public function isMenuId(...$ids): bool |
||
27 | { |
||
28 | foreach ($ids as $id) { |
||
29 | if ($id == $this->getMenuId()) { |
||
30 | return true; |
||
31 | } |
||
32 | } |
||
33 | return false; |
||
34 | } |
||
35 | |||
36 | public function isPage($pattern): bool |
||
37 | { |
||
38 | return Str::is($pattern, $this->getPage()); |
||
39 | } |
||
40 | } |
||
41 |