austinheap /
laravel-database-influxdb
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * src/Jobs/WritePayload.php. |
||
| 4 | * |
||
| 5 | * @author Austin Heap <[email protected]> |
||
| 6 | * @version v0.1.7 |
||
| 7 | */ |
||
| 8 | declare(strict_types=1); |
||
| 9 | |||
| 10 | namespace AustinHeap\Database\InfluxDb\Jobs; |
||
| 11 | |||
| 12 | use AustinHeap\Database\InfluxDb\InfluxDbServiceProvider; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Class WritePayload. |
||
| 16 | */ |
||
| 17 | class WritePayload extends Job |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var string PRECISION_NANOSECONDS |
||
| 21 | */ |
||
| 22 | const PRECISION_NANOSECONDS = 'n'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string PRECISION_MICROSECONDS |
||
| 26 | */ |
||
| 27 | const PRECISION_MICROSECONDS = 'u'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string PRECISION_MILLISECONDS |
||
| 31 | */ |
||
| 32 | const PRECISION_MILLISECONDS = 'ms'; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var string PRECISION_SECONDS |
||
| 36 | */ |
||
| 37 | const PRECISION_SECONDS = 's'; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var string PRECISION_MINUTES |
||
| 41 | */ |
||
| 42 | const PRECISION_MINUTES = 'm'; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var string PRECISION_HOURS |
||
| 46 | */ |
||
| 47 | const PRECISION_HOURS = 'h'; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @var string|array |
||
| 51 | */ |
||
| 52 | public $payload = null; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @var string |
||
| 56 | */ |
||
| 57 | public $precision = null; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @var string|null |
||
| 61 | */ |
||
| 62 | public $retentionPolicy = null; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * WritePayload constructor. |
||
| 66 | * |
||
| 67 | * @param string|array $payload |
||
| 68 | * @param string $precision |
||
| 69 | * @param string|null $retentionPolicy |
||
| 70 | */ |
||
| 71 | public function __construct($payload, $precision = self::PRECISION_SECONDS, $retentionPolicy = null) |
||
| 72 | { |
||
| 73 | $this->payload = $payload; |
||
| 74 | $this->precision = $precision; |
||
| 75 | $this->retentionPolicy = $retentionPolicy; |
||
| 76 | |||
| 77 | parent::__construct( |
||
| 78 | [ |
||
| 79 | 'payload' => $this->payload, |
||
| 80 | 'precision' => $this->precision, |
||
| 81 | 'retentionPolicy' => $this->retentionPolicy, |
||
| 82 | ] |
||
| 83 | ); |
||
| 84 | } |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @return void |
||
| 88 | */ |
||
| 89 | public function handle() |
||
| 90 | { |
||
| 91 | InfluxDbServiceProvider::getInstance() |
||
| 92 | ->writePayload( |
||
|
0 ignored issues
–
show
|
|||
| 93 | $this->payload, |
||
| 94 | $this->precision, |
||
| 95 | $this->retentionPolicy |
||
| 96 | ); |
||
| 97 | } |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @return array |
||
| 101 | */ |
||
| 102 | public function tags(): array |
||
| 103 | { |
||
| 104 | return [static::class.':'.(is_string($this->payload) ? 1 : count($this->payload))]; |
||
| 105 | } |
||
| 106 | } |
||
| 107 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.