PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.0.0
Backup Migration v2.0.0
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / analyst / src / Http / Requests / DeactivateRequest.php
backup-backup / analyst / src / Http / Requests Last commit date
AbstractLoggerRequest.php 8 months ago ActivateRequest.php 8 months ago DeactivateRequest.php 8 months ago InstallRequest.php 8 months ago OptInRequest.php 8 months ago OptOutRequest.php 8 months ago UninstallRequest.php 8 months ago
DeactivateRequest.php
65 lines
1 <?php
2
3 namespace Analyst\Http\Requests;
4
5 use Analyst\ApiResponse;
6 use Analyst\Collector;
7 use Analyst\Contracts\RequestorContract;
8
9 /**
10 * Class DeactivateRequest
11 *
12 * @since 0.9.10
13 */
14 class DeactivateRequest extends AbstractLoggerRequest
15 {
16 /**
17 * @var string
18 */
19 protected $question;
20
21 /**
22 * @var string
23 */
24 protected $answer;
25
26 /**
27 * @param Collector $collector
28 * @param $pluginId
29 * @param $path
30 * @param $question
31 * @param $answer
32 * @return static
33 */
34 public static function make(Collector $collector, $pluginId, $path, $question, $answer)
35 {
36 return new static($collector, $pluginId, $path, $question, $answer);
37 }
38
39 public function __construct(Collector $collector, $pluginId, $path, $question, $answer)
40 {
41 parent::__construct($collector, $pluginId, $path);
42
43 $this->question = $question;
44 $this->answer = $answer;
45 }
46
47 public function toArray()
48 {
49 return array_merge(parent::toArray(), [
50 'question' => $this->question,
51 'answer' => $this->answer,
52 ]);
53 }
54
55 /**
56 * Execute the request
57 * @param RequestorContract $requestor
58 * @return ApiResponse
59 */
60 public function execute(RequestorContract $requestor)
61 {
62 return $requestor->post('logger/deactivate', $this->toArray());
63 }
64 }
65