| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function __construct() |
||
| 15 | { |
||
| 16 | $this->api_key = config('laravel-sift-science.api_key'); |
||
|
|
|||
| 17 | $this->account_id = config('laravel-sift-science.account_id'); |
||
| 18 | $this->timeout = config('laravel-sift-science.timeout'); |
||
| 19 | $this->version = config('laravel-sift-science.version'); |
||
| 20 | |||
| 21 | if (!$this->api_key || !$this->account_id) { |
||
| 22 | throw new \InvalidArgumentException( |
||
| 23 | 'Please set SIFT_SCIENCE_API_KEY and SIFT_SCIENCE_ACCOUNT_ID environment variables.' |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | $this->siftclient = new \SiftClient([ |
||
| 28 | 'api_key' => $this->api_key, |
||
| 29 | 'account_id' => $this->account_id, |
||
| 30 | ]); |
||
| 31 | } |
||
| 32 | |||
| 47 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: