Passed
Pull Request — develop (#1)
by
unknown
03:11
created
src/Commands/CheckInvitation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,14 +41,14 @@
 block discarded – undo
41 41
      */
42 42
     public function handle()
43 43
     {
44
-        $email = $this->argument('email') ? : null;
44
+        $email = $this->argument('email') ?: null;
45 45
         $code = $this->argument('code');
46 46
 
47 47
         try {
48 48
             LaravelInvites::check($code, $email);
49 49
             $this->info('This code is valid');
50 50
         }
51
-        catch(LaravelInvitesException $e)
51
+        catch (LaravelInvitesException $e)
52 52
         {
53 53
             $this->error($e->getMessage());
54 54
         }
Please login to merge, or discard this patch.
src/Mail/InvitationMail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             'code' => (string) $this->invite->code
40 40
         ];
41 41
 
42
-        if($this->invite->valid_upto)
42
+        if ($this->invite->valid_upto)
43 43
         {
44 44
             $url = URL::temporarySignedRoute('laravelinvites.routes.follow', $this->invite->valid_upto, $data);
45 45
         }
Please login to merge, or discard this patch.
src/database/migrations/2019_01_22_052953_create_invites_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create(config('laravelinvites.table'), function (Blueprint $table) {
16
+        Schema::create(config('laravelinvites.table'), function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('email')->nullable()->unique();
19 19
             $table->string('code')->unique();
Please login to merge, or discard this patch.
src/Models/Invite.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $this->increment('used_count');
39 39
 
40
-        if($this->used_count >= $this->allowed_count && config('laravelinvites.delete_on_full', true))
40
+        if ($this->used_count >= $this->allowed_count && config('laravelinvites.delete_on_full', true))
41 41
             $this->delete();
42 42
     }
43 43
 
44 44
     public function scopeValid($query)
45 45
     {
46
-        return $query->where('valid_from','<=', now())
46
+        return $query->where('valid_from', '<=', now())
47 47
             ->where('valid_upto', '>=', now())
48 48
             ->whereRaw('allowed_count > used_count');
49 49
     }
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
      */
60 60
     private function setDefaultExpiry()
61 61
     {
62
-        if(config('laravelinvites.expiry.type')==='none')
62
+        if (config('laravelinvites.expiry.type') === 'none')
63 63
             return null;
64 64
         
65
-        if(config('laravelinvites.expiry.type') === 'hours')
65
+        if (config('laravelinvites.expiry.type') === 'hours')
66 66
             return now()->addHours(config('laravelinvites.expiry.value'));
67 67
             
68
-        elseif(config('laravelinvites.expiry.type') === "days")
68
+        elseif (config('laravelinvites.expiry.type') === "days")
69 69
             return now()->addDays(config('laravelinvites.expiry.days'));
70 70
     }
71 71
 }
72 72
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/InvitationNotValidWithEmailException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct($email, $valid_email)
10 10
     {
11
-        if($email)
11
+        if ($email)
12 12
             parent::__construct("This invitation code is not valid with this $email");
13 13
         else
14 14
             parent::__construct("This invitation code is valid only for $valid_email");
Please login to merge, or discard this patch.
src/Commands/GenerateInvitations.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,17 +43,17 @@
 block discarded – undo
43 43
      */
44 44
     public function handle()
45 45
     {
46
-        $email = $this->argument('email') ? : null;
46
+        $email = $this->argument('email') ?: null;
47 47
         $allow = $this->option('allow');
48 48
         $count = $this->option('count');
49 49
         $hours = (int) $this->option('hours');
50 50
         $days = (int) $this->option('days');
51 51
 
52
-        $invite = LaravelInvites::for($email)->allow($allow);
52
+        $invite = LaravelInvites::for ($email)->allow($allow);
53 53
 
54
-        if($days)
54
+        if ($days)
55 55
             $invite->setExpiry(now()->addDays($days));
56
-        else if($hours)
56
+        else if ($hours)
57 57
             $invite->setExpiry(now()->addHours($hours));
58 58
 
59 59
         $invite->generate($count);
Please login to merge, or discard this patch.
src/LaravelInvites.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
      */
107 107
     public function validFrom(Carbon $date)
108 108
     {
109
-        $this->data['valid_from'] = $date ? : now();
109
+        $this->data['valid_from'] = $date ?: now();
110 110
 
111 111
         return $this;
112 112
     }
Please login to merge, or discard this patch.