PluginProbe
Metricool – Social media and site statistics / 2.1.1
Metricool – Social media and site statistics v2.1.1
2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
← All changes | app/Exceptions/RestDataException.php +33 -0 2.0.0 → 2.1.1 View file →
@@ -1,0 +1,33 @@
1 +<?php
2 +
3 +declare(strict_types=1);
4 +
5 +namespace Metricool\Exceptions;
6 +
7 +class RestDataException extends \Exception
8 +{
9 + protected array $data = [];
10 + protected int $statusCode = 400;
11 +
12 + public function setResponseCode(int $code): RestDataException
13 + {
14 + $this->statusCode = $code;
15 + return $this;
16 + }
17 +
18 + public function getResponseCode(): int
19 + {
20 + return $this->statusCode;
21 + }
22 +
23 + public function setData(array $data): RestDataException
24 + {
25 + $this->data = $data;
26 + return $this;
27 + }
28 +
29 + public function getData(): array
30 + {
31 + return $this->data;
32 + }
33 +}