@@ -23,17 +23,17 @@ |
||
| 23 | 23 | |
| 24 | 24 | $link = $request->get('link'); |
| 25 | 25 | |
| 26 | - if($link->clickLimitReached()) { |
|
| 26 | + if ($link->clickLimitReached()) { |
|
| 27 | 27 | throw new LinkClickLimitReachedException; |
| 28 | 28 | } |
| 29 | - if($link->group && $link->group->clickLimitReached()) { |
|
| 29 | + if ($link->group && $link->group->clickLimitReached()) { |
|
| 30 | 30 | throw new LinkGroupClickLimitReachedException; |
| 31 | 31 | } |
| 32 | - if($link->expired()) { |
|
| 32 | + if ($link->expired()) { |
|
| 33 | 33 | throw new LinkExpiredException; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if($link->group && $link->group->expired() && $link->expiry === null) { |
|
| 36 | + if ($link->group && $link->group->expired() && $link->expiry === null) { |
|
| 37 | 37 | throw new LinkGroupExpiredException; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function clickLimitReached() |
| 42 | 42 | { |
| 43 | - if($this->click_limit === null) { |
|
| 43 | + if ($this->click_limit === null) { |
|
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | return $this->click_limit <= $this->links->sum('clicks'); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function expired() |
| 50 | 50 | { |
| 51 | - if($this->expiry === null) { |
|
| 51 | + if ($this->expiry === null) { |
|
| 52 | 52 | return false; |
| 53 | 53 | } |
| 54 | 54 | return !(new Carbon($this->expiry))->isFuture(); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public static function boot() |
| 54 | 54 | { |
| 55 | 55 | parent::boot(); |
| 56 | - self::creating(function ($model) { |
|
| 56 | + self::creating(function($model) { |
|
| 57 | 57 | $model->uuid = $model->uuid ?: resolve(UuidCreator::class)->create(); |
| 58 | 58 | }); |
| 59 | 59 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | public function clickLimitReached() |
| 76 | 76 | { |
| 77 | - if($this->click_limit === null) { |
|
| 77 | + if ($this->click_limit === null) { |
|
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | 80 | return $this->click_limit <= $this->clicks; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function expired() |
| 84 | 84 | { |
| 85 | - if($this->expiry === null) { |
|
| 85 | + if ($this->expiry === null) { |
|
| 86 | 86 | return false; |
| 87 | 87 | } |
| 88 | 88 | return !(new Carbon($this->expiry))->isFuture(); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | public function normalise($expiry) |
| 10 | 10 | { |
| 11 | - if(is_int($expiry)) { |
|
| 11 | + if (is_int($expiry)) { |
|
| 12 | 12 | return (new Carbon())->setTimestamp($expiry); |
| 13 | 13 | } |
| 14 | 14 | |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | public function normalise($expiry) |
| 9 | 9 | { |
| 10 | - if($expiry instanceof \DateTime) { |
|
| 10 | + if ($expiry instanceof \DateTime) { |
|
| 11 | 11 | return $expiry; |
| 12 | 12 | } |
| 13 | 13 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | final public function setSuccessor(ExpiryNormaliser $successor) |
| 14 | 14 | { |
| 15 | - if($this->successor === null) { |
|
| 15 | + if ($this->successor === null) { |
|
| 16 | 16 | $this->successor = $successor; |
| 17 | 17 | } else { |
| 18 | 18 | $this->successor->setSuccessor($successor); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | public function normalise($expiry) |
| 10 | 10 | { |
| 11 | - if(is_string($expiry)) { |
|
| 11 | + if (is_string($expiry)) { |
|
| 12 | 12 | return new Carbon($expiry); |
| 13 | 13 | } |
| 14 | 14 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function pushNormaliser(ExpiryNormaliser $normaliser) |
| 16 | 16 | { |
| 17 | - if($this->normaliser === null) { |
|
| 17 | + if ($this->normaliser === null) { |
|
| 18 | 18 | $this->normaliser = $normaliser; |
| 19 | 19 | } else { |
| 20 | 20 | $this->normaliser->setSuccessor($normaliser); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function appendQuery(array $newQuery) |
| 30 | 30 | { |
| 31 | - foreach($newQuery as $key => $value) { |
|
| 31 | + foreach ($newQuery as $key => $value) { |
|
| 32 | 32 | $this->url = $this->url->withQueryParameter($key, $value); |
| 33 | 33 | } |
| 34 | 34 | } |