File tree Expand file tree Collapse file tree 4 files changed +20
-34
lines changed
Expand file tree Collapse file tree 4 files changed +20
-34
lines changed Original file line number Diff line number Diff line change 1414 ValidateSupporter::class => 'ef1a42701af6dc36e052556a0ee1c762394f9428 ' ,
1515 ValidatePro::class => '482b48f1a026684b6c1754e45ca180ffc52483ff ' ,
1616 ValidateSignature::class => '5a8a855d4b59c44c298daa66801c79f2aba20492 ' ,
17- Verify::class => 'aba420193a9d017e36a215ef8dbd6332bd2c2525 ' ,
17+ Verify::class => 'f15a25c69847bf635c7b0cc730ea24a5aaf008b8 ' ,
1818 VerifySupporterStatus::class => '6358c45ed0414c1e2697e0881238659fa6221bed ' ,
1919 VerifyProStatus::class => '212e6ada794587ee8e2b81cf76e243d134a7e823 ' ,
2020 VerifyServiceProvider::class => '923b63b15d25e69b95ed1d5ec1c82ba57f1a7d74 ' ,
21- VerifyTrait::class => '1a0679c1d63b209b9427de6073e48bb1246e02a4 ' ,
21+ VerifyTrait::class => '2a2543fb702b95fe0d4cc78319bef6906a41f093 ' ,
2222 ],
2323];
Original file line number Diff line number Diff line change 22
33namespace LycheeVerify \Contract ;
44
5- use LycheeVerify \Exceptions \SupporterOnlyOperationException ;
6-
75interface VerifyInterface
86{
97 /**
@@ -43,18 +41,6 @@ public function is_pro(): bool;
4341 */
4442 public function is_signature (): bool ;
4543
46- /**
47- * Authorize the operation if the installation is verified.
48- * Otherwise throw an exception.
49- *
50- * @param Status $required_status (default to SUPPORTER_EDITION)
51- *
52- * @return void
53- *
54- * @throws SupporterOnlyOperationException
55- */
56- public function authorize (Status $ required_status = Status::SUPPORTER_EDITION ): void ;
57-
5844 /**
5945 * Fork depending whether the installation is verified or not.
6046 *
Original file line number Diff line number Diff line change 55use Illuminate \Support \Facades \DB ;
66use LycheeVerify \Contract \Status ;
77use LycheeVerify \Contract \VerifyInterface ;
8+ use LycheeVerify \Exceptions \SupporterOnlyOperationException ;
89use LycheeVerify \Validators \ValidatePro ;
910use LycheeVerify \Validators \ValidateSignature ;
1011use LycheeVerify \Validators \ValidateSupporter ;
@@ -87,4 +88,21 @@ public function validate(): bool
8788
8889 return true ;
8990 }
91+
92+ /**
93+ * Authorize the operation if the installation is verified.
94+ * Otherwise throw an exception.
95+ *
96+ * @param Status $required_status (default to SUPPORTER_EDITION)
97+ *
98+ * @return void
99+ *
100+ * @throws SupporterOnlyOperationException
101+ */
102+ public function authorize (Status $ required_status = Status::SUPPORTER_EDITION ): void
103+ {
104+ if (!$ this ->check ($ required_status )) {
105+ throw new SupporterOnlyOperationException ($ required_status );
106+ }
107+ }
90108}
Original file line number Diff line number Diff line change 33namespace LycheeVerify ;
44
55use LycheeVerify \Contract \Status ;
6- use LycheeVerify \Exceptions \SupporterOnlyOperationException ;
76
87trait VerifyTrait
98{
@@ -62,23 +61,6 @@ public function is_signature(): bool
6261 return $ this ->check (Status::SIGNATURE_EDITION );
6362 }
6463
65- /**
66- * Authorize the operation if the installation is verified.
67- * Otherwise throw an exception.
68- *
69- * @param Status $required_status (default to SUPPORTER_EDITION)
70- *
71- * @return void
72- *
73- * @throws SupporterOnlyOperationException
74- */
75- public function authorize (Status $ required_status = Status::SUPPORTER_EDITION ): void
76- {
77- if (!$ this ->check ($ required_status )) {
78- throw new SupporterOnlyOperationException ($ required_status );
79- }
80- }
81-
8264 /**
8365 * Fork depending whether the installation is verified or not.
8466 *
You can’t perform that action at this time.
0 commit comments