Completed
Push — master ( 3492a0...aa551b )
by Temitope
02:15
created
src/Auth/Middleware.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
src/Model/Emoji.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
src/Model/User.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
src/Model/Keyword.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
src/Model/Category.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
src/Auth/Oauth.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@
 block discarded – undo
51 51
     /**
52 52
      * This method creates user
53 53
      *
54
-     * @param $user
54
+     * @param UserController $user
55 55
      * @param $userParams
56
-     * @param $response
56
+     * @param Response $response
57 57
      *
58 58
      * @return json $response
59 59
      */
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $user = User::where('username', '=', $loginParams['username'])->get()->first();
91 91
 
92 92
             if (count($user) > 0) {
93
-                $userInfo = ['id' => $user->id,];
93
+                $userInfo = ['id' => $user->id, ];
94 94
 
95 95
                 if (password_verify($loginParams['password'], $user->password)) {
96 96
                     $token = $this->buildAcessToken($userInfo);
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
          * Create the token params as an array
162 162
          */
163 163
         $data = [
164
-            'iat'  => $issuedAt,         // Issued at: time when the token was generated
165
-            'jti'  => $tokenId,          // Json Token Id: an unique identifier for the token
166
-            'iss'  => $serverName,       // Issuer
167
-            'nbf'  => $notBefore,        // Not before
168
-            'exp'  => $expire,           // Expire
169
-            'dat'  => $userData,         // User Information retrieved from the database
164
+            'iat'  => $issuedAt, // Issued at: time when the token was generated
165
+            'jti'  => $tokenId, // Json Token Id: an unique identifier for the token
166
+            'iss'  => $serverName, // Issuer
167
+            'nbf'  => $notBefore, // Not before
168
+            'exp'  => $expire, // Expire
169
+            'dat'  => $userData, // User Information retrieved from the database
170 170
         ];
171 171
 
172 172
         $loadEnv = DatabaseConnection::loadEnv();
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $secretKey = base64_decode(getenv('secret'));
175 175
 
176 176
         $jwt = JWT::encode(
177
-        $data,      //Data to be encoded in the JWT
177
+        $data, //Data to be encoded in the JWT
178 178
         $secretKey, // The signing key
179 179
         'HS512'     // Algorithm used to sign the token
180 180
         );
Please login to merge, or discard this patch.
src/Database/DatabaseConnection.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 namespace Laztopaz\EmojiRestfulAPI;
7 7
 
8 8
 use Dotenv\Dotenv;
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
         $this->capsule->bootEloquent();
49 49
     }
50 50
 
51
-     /**
52
-      * Load Dotenv to grant getenv() access to
53
-      * environment variables in .env file.
54
-      */
55
-     public static function loadEnv()
56
-     {
57
-         if (!getenv('APP_ENV')) {
58
-             $dotenv = new Dotenv(__DIR__.'/../../');
59
-             $dotenv->load();
60
-         }
61
-     }
51
+        /**
52
+         * Load Dotenv to grant getenv() access to
53
+         * environment variables in .env file.
54
+         */
55
+        public static function loadEnv()
56
+        {
57
+            if (!getenv('APP_ENV')) {
58
+                $dotenv = new Dotenv(__DIR__.'/../../');
59
+                $dotenv->load();
60
+            }
61
+        }
62 62
 }
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
src/Database/Schema.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author   Temitope Olotin <[email protected]>
4
- * @license  <https://opensource.org/license/MIT> MIT
5
- */
3
+     * @author   Temitope Olotin <[email protected]>
4
+     * @license  <https://opensource.org/license/MIT> MIT
5
+     */
6 6
 
7 7
 namespace Laztopaz\EmojiRestfulAPI;
8 8
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function createUser()
27 27
     {
28 28
         if (!Capsule::schema()->hasTable('users')) {
29
-            Capsule::schema()->create('users', function ($table) {
29
+            Capsule::schema()->create('users', function($table) {
30 30
                 $table->increments('id');
31 31
                 $table->string('firstname');
32 32
                 $table->string('lastname');
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function createKeyword()
45 45
     {
46 46
         if (!Capsule::schema()->hasTable('keywords')) {
47
-            Capsule::schema()->create('keywords', function ($table) {
47
+            Capsule::schema()->create('keywords', function($table) {
48 48
                 $table->increments('id');
49 49
                 $table->integer('emoji_id');
50 50
                 $table->string('keyword_name');
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function createCategory()
60 60
     {
61 61
         if (!Capsule::schema()->hasTable('categories')) {
62
-            Capsule::schema()->create('categories', function ($table) {
62
+            Capsule::schema()->create('categories', function($table) {
63 63
                 $table->increments('id');
64 64
                 $table->string('category_name');
65 65
                 $table->timestamps();
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function createEmoji()
74 74
     {
75 75
         if (!Capsule::schema()->hasTable('emojis')) {
76
-            Capsule::schema()->create('emojis', function ($table) {
76
+            Capsule::schema()->create('emojis', function($table) {
77 77
                 $table->increments('id');
78 78
                 $table->string('name');
79 79
                 $table->string('char');
Please login to merge, or discard this patch.