Completed
Branch master (0dfbed)
by Benedikt
07:50
created
config-example/jwt.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
   'keys' => [
49 49
 
50
-    /*
50
+	/*
51 51
     |--------------------------------------------------------------------------
52 52
     | Public Key
53 53
     |--------------------------------------------------------------------------
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
     |
59 59
     */
60 60
 
61
-    'public' => env('JWT_PUBLIC_KEY'),
61
+	'public' => env('JWT_PUBLIC_KEY'),
62 62
 
63
-    /*
63
+	/*
64 64
     |--------------------------------------------------------------------------
65 65
     | Private Key
66 66
     |--------------------------------------------------------------------------
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
     |
72 72
     */
73 73
 
74
-    'private' => env('JWT_PRIVATE_KEY'),
74
+	'private' => env('JWT_PRIVATE_KEY'),
75 75
 
76
-    /*
76
+	/*
77 77
     |--------------------------------------------------------------------------
78 78
     | Passphrase
79 79
     |--------------------------------------------------------------------------
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     |
83 83
     */
84 84
 
85
-    'passphrase' => env('JWT_PASSPHRASE'),
85
+	'passphrase' => env('JWT_PASSPHRASE'),
86 86
 
87 87
   ],
88 88
 
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
   */
149 149
 
150 150
   'required_claims' => [
151
-    'iss',
152
-    'iat',
153
-    'exp',
154
-    'nbf',
155
-    'sub',
156
-    'jti',
151
+	'iss',
152
+	'iat',
153
+	'exp',
154
+	'nbf',
155
+	'sub',
156
+	'jti',
157 157
   ],
158 158
 
159 159
   /*
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
   */
171 171
 
172 172
   'persistent_claims' => [
173
-    // 'foo',
174
-    // 'bar',
173
+	// 'foo',
174
+	// 'bar',
175 175
   ],
176 176
 
177 177
   /*
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
   'providers' => [
214 214
 
215
-    /*
215
+	/*
216 216
     |--------------------------------------------------------------------------
217 217
     | JWT Provider
218 218
     |--------------------------------------------------------------------------
@@ -221,9 +221,9 @@  discard block
 block discarded – undo
221 221
     |
222 222
     */
223 223
 
224
-    'jwt' => Tymon\JWTAuth\Providers\JWT\Namshi::class,
224
+	'jwt' => Tymon\JWTAuth\Providers\JWT\Namshi::class,
225 225
 
226
-    /*
226
+	/*
227 227
     |--------------------------------------------------------------------------
228 228
     | Authentication Provider
229 229
     |--------------------------------------------------------------------------
@@ -232,9 +232,9 @@  discard block
 block discarded – undo
232 232
     |
233 233
     */
234 234
 
235
-    'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class,
235
+	'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class,
236 236
 
237
-    /*
237
+	/*
238 238
     |--------------------------------------------------------------------------
239 239
     | Storage Provider
240 240
     |--------------------------------------------------------------------------
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     |
244 244
     */
245 245
 
246
-    'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class,
246
+	'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class,
247 247
 
248 248
   ],
249 249
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /*
5 5
  * This file is part of jwt-auth.
Please login to merge, or discard this patch.
config-example/database.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@
 block discarded – undo
29 29
   |
30 30
   */
31 31
   'connections' => [
32
-    'mysql' => [
33
-      'driver' => 'mysql',
34
-      'host' => env('DB_HOST', 'localhost'),
35
-      'database' => env('DB_DATABASE'),
36
-      'username' => env('DB_USERNAME'),
37
-      'password' => env('DB_PASSWORD'),
38
-      'charset' => 'utf8',
39
-      'collation' => 'utf8_unicode_ci',
40
-      'prefix' => '',
41
-      'strict' => false,
42
-    ]
32
+	'mysql' => [
33
+	  'driver' => 'mysql',
34
+	  'host' => env('DB_HOST', 'localhost'),
35
+	  'database' => env('DB_DATABASE'),
36
+	  'username' => env('DB_USERNAME'),
37
+	  'password' => env('DB_PASSWORD'),
38
+	  'charset' => 'utf8',
39
+	  'collation' => 'utf8_unicode_ci',
40
+	  'prefix' => '',
41
+	  'strict' => false,
42
+	]
43 43
   ],
44 44
 ];
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 return [
5 5
   /*
Please login to merge, or discard this patch.
config-example/auth.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,22 +3,22 @@
 block discarded – undo
3 3
 
4 4
 return [
5 5
   'defaults' => [
6
-    'guard' => env('AUTH_GUARD', 'api'),
7
-    'passwords' => 'users',
6
+	'guard' => env('AUTH_GUARD', 'api'),
7
+	'passwords' => 'users',
8 8
   ],
9 9
   'guards' => [
10
-    'api' => [
11
-      'driver' => 'jwt-auth',
12
-      'provider' => 'users'
13
-    ],
10
+	'api' => [
11
+	  'driver' => 'jwt-auth',
12
+	  'provider' => 'users'
13
+	],
14 14
 
15
-    // ...
15
+	// ...
16 16
   ],
17 17
 
18 18
   'providers' => [
19
-    'users' => [
20
-      'driver' => 'doctrine',
21
-      'model' => \Tfboe\FmLib\Entity\User::class
22
-    ],
19
+	'users' => [
20
+	  'driver' => 'doctrine',
21
+	  'model' => \Tfboe\FmLib\Entity\User::class
22
+	],
23 23
   ],
24 24
 ];
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 return [
5 5
   'defaults' => [
Please login to merge, or discard this patch.
config-example/doctrine.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -22,23 +22,23 @@  discard block
 block discarded – undo
22 22
   |
23 23
   */
24 24
   'managers' => [
25
-    'default' => [
26
-      'dev' => env('APP_DEBUG'),
27
-      'meta' => env('DOCTRINE_METADATA', 'annotations'),
28
-      'connection' => env('DB_CONNECTION', 'mysql'),
29
-      'namespaces' => [
30
-        'Tfboe\FmLib\Entity'
31
-      ],
32
-      'paths' => [
33
-        base_path('vendor/tfboe/fm-lib/src/Entity'),
34
-      ],
35
-      'repository' => Doctrine\ORM\EntityRepository::class,
36
-      'proxies' => [
37
-        'namespace' => false,
38
-        'path' => storage_path('proxies'),
39
-        'auto_generate' => env('DOCTRINE_PROXY_AUTOGENERATE', false)
40
-      ],
41
-      /*
25
+	'default' => [
26
+	  'dev' => env('APP_DEBUG'),
27
+	  'meta' => env('DOCTRINE_METADATA', 'annotations'),
28
+	  'connection' => env('DB_CONNECTION', 'mysql'),
29
+	  'namespaces' => [
30
+		'Tfboe\FmLib\Entity'
31
+	  ],
32
+	  'paths' => [
33
+		base_path('vendor/tfboe/fm-lib/src/Entity'),
34
+	  ],
35
+	  'repository' => Doctrine\ORM\EntityRepository::class,
36
+	  'proxies' => [
37
+		'namespace' => false,
38
+		'path' => storage_path('proxies'),
39
+		'auto_generate' => env('DOCTRINE_PROXY_AUTOGENERATE', false)
40
+	  ],
41
+	  /*
42 42
       |--------------------------------------------------------------------------
43 43
       | Doctrine events
44 44
       |--------------------------------------------------------------------------
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
       | e.g. Doctrine\ORM\Events::onFlush
48 48
       |
49 49
       */
50
-      'events' => [
51
-        'listeners' => [],
52
-        'subscribers' => []
53
-      ],
54
-      'filters' => [],
55
-      /*
50
+	  'events' => [
51
+		'listeners' => [],
52
+		'subscribers' => []
53
+	  ],
54
+	  'filters' => [],
55
+	  /*
56 56
       |--------------------------------------------------------------------------
57 57
       | Doctrine mapping types
58 58
       |--------------------------------------------------------------------------
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
       | http://symfony.com/doc/current/cookbook/doctrine/dbal.html#registering-custom-mapping-types-in-the-schematool
76 76
       |--------------------------------------------------------------------------
77 77
       */
78
-      'mapping_types' => [
79
-        //'enum' => 'string'
80
-      ]
81
-    ]
78
+	  'mapping_types' => [
79
+		//'enum' => 'string'
80
+	  ]
81
+	]
82 82
   ],
83 83
   /*
84 84
   |--------------------------------------------------------------------------
@@ -92,16 +92,16 @@  discard block
 block discarded – undo
92 92
   |
93 93
   */
94 94
   'extensions' => [
95
-    //LaravelDoctrine\ORM\Extensions\TablePrefix\TablePrefixExtension::class,
96
-    LaravelDoctrine\Extensions\Timestamps\TimestampableExtension::class,
97
-    //LaravelDoctrine\Extensions\SoftDeletes\SoftDeleteableExtension::class,
98
-    //LaravelDoctrine\Extensions\Sluggable\SluggableExtension::class,
99
-    //LaravelDoctrine\Extensions\Sortable\SortableExtension::class,
100
-    //LaravelDoctrine\Extensions\Tree\TreeExtension::class,
101
-    //LaravelDoctrine\Extensions\Loggable\LoggableExtension::class,
102
-    //LaravelDoctrine\Extensions\Blameable\BlameableExtension::class,
103
-    //LaravelDoctrine\Extensions\IpTraceable\IpTraceableExtension::class,
104
-    //LaravelDoctrine\Extensions\Translatable\TranslatableExtension::class
95
+	//LaravelDoctrine\ORM\Extensions\TablePrefix\TablePrefixExtension::class,
96
+	LaravelDoctrine\Extensions\Timestamps\TimestampableExtension::class,
97
+	//LaravelDoctrine\Extensions\SoftDeletes\SoftDeleteableExtension::class,
98
+	//LaravelDoctrine\Extensions\Sluggable\SluggableExtension::class,
99
+	//LaravelDoctrine\Extensions\Sortable\SortableExtension::class,
100
+	//LaravelDoctrine\Extensions\Tree\TreeExtension::class,
101
+	//LaravelDoctrine\Extensions\Loggable\LoggableExtension::class,
102
+	//LaravelDoctrine\Extensions\Blameable\BlameableExtension::class,
103
+	//LaravelDoctrine\Extensions\IpTraceable\IpTraceableExtension::class,
104
+	//LaravelDoctrine\Extensions\Translatable\TranslatableExtension::class
105 105
   ],
106 106
   /*
107 107
   |--------------------------------------------------------------------------
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
   |--------------------------------------------------------------------------
113 113
   */
114 114
   'custom_types' => [
115
-    'json' => LaravelDoctrine\ORM\Types\Json::class
115
+	'json' => LaravelDoctrine\ORM\Types\Json::class
116 116
   ],
117 117
   /*
118 118
   |--------------------------------------------------------------------------
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
   |
158 158
   */
159 159
   'cache' => [
160
-    'default' => env('DOCTRINE_CACHE', 'array'),
161
-    'namespace' => null,
162
-    'second_level' => false,
160
+	'default' => env('DOCTRINE_CACHE', 'array'),
161
+	'namespace' => null,
162
+	'second_level' => false,
163 163
   ],
164 164
   /*
165 165
   |--------------------------------------------------------------------------
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
   |
173 173
   */
174 174
   'gedmo' => [
175
-    'all_mappings' => false
175
+	'all_mappings' => false
176 176
   ],
177 177
   /*
178 178
    |--------------------------------------------------------------------------
@@ -193,6 +193,6 @@  discard block
 block discarded – undo
193 193
    |
194 194
    */
195 195
   'notifications' => [
196
-    'channel' => 'database'
196
+	'channel' => 'database'
197 197
   ]
198 198
 ];
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 return [
5 5
 
Please login to merge, or discard this patch.
config-example/cache.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,28 +13,28 @@
 block discarded – undo
13 13
   |
14 14
   */
15 15
   'stores' => [
16
-    'array' => [
17
-      'driver' => 'array'
18
-    ],
19
-    'apc' => [
20
-      'driver' => 'apc',
21
-    ],
22
-    'file' => [
23
-      'driver' => 'file',
24
-      'path' => storage_path('framework/cache'),
25
-    ],
26
-    'memcached' => [
27
-      'driver' => 'memcached',
28
-      'servers' => [
29
-        [
30
-          'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100,
31
-        ],
32
-      ],
33
-    ],
34
-    'redis' => [
35
-      'driver' => 'redis',
36
-      'connection' => 'default',
37
-    ],
16
+	'array' => [
17
+	  'driver' => 'array'
18
+	],
19
+	'apc' => [
20
+	  'driver' => 'apc',
21
+	],
22
+	'file' => [
23
+	  'driver' => 'file',
24
+	  'path' => storage_path('framework/cache'),
25
+	],
26
+	'memcached' => [
27
+	  'driver' => 'memcached',
28
+	  'servers' => [
29
+		[
30
+		  'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100,
31
+		],
32
+	  ],
33
+	],
34
+	'redis' => [
35
+	  'driver' => 'redis',
36
+	  'connection' => 'default',
37
+	],
38 38
   ],
39 39
 
40 40
   'default' => env('CACHE_DRIVER'),
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 return [
5 5
   /*
Please login to merge, or discard this patch.
src/Claims/Version.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 /**
4 4
  * Created by PhpStorm.
5 5
  * User: benedikt
Please login to merge, or discard this patch.
src/routes.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
    *                               too short
21 21
    */
22 22
   $router->post('register', [
23
-    'as' => 'register', 'uses' => 'UserController@register'
23
+	'as' => 'register', 'uses' => 'UserController@register'
24 24
   ]);
25 25
 
26 26
   /**
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
    *                               too short
40 40
    */
41 41
   $router->post('login', [
42
-    'as' => 'login', 'uses' => 'UserController@login'
42
+	'as' => 'login', 'uses' => 'UserController@login'
43 43
   ]);
44 44
 
45 45
   $router->group(['middleware' => 'auth:api'], function () use ($router) {
46
-    /**
47
-     * @api {get} /userId Get User ID
48
-     * @apiUse AuthenticatedRequest
49
-     * @apiVersion 0.1.0
50
-     * @apiDescription Gets the user id of the currently logged in user
51
-     * @apiName GetUserId
52
-     * @apiGroup User
53
-     *
54
-     * @apiSuccess {string} id the id of the user
55
-     */
56
-    $router->get('userId', [
57
-      'as' => 'userId', 'uses' => 'UserController@userId'
58
-    ]);
46
+	/**
47
+	 * @api {get} /userId Get User ID
48
+	 * @apiUse AuthenticatedRequest
49
+	 * @apiVersion 0.1.0
50
+	 * @apiDescription Gets the user id of the currently logged in user
51
+	 * @apiName GetUserId
52
+	 * @apiGroup User
53
+	 *
54
+	 * @apiSuccess {string} id the id of the user
55
+	 */
56
+	$router->get('userId', [
57
+	  'as' => 'userId', 'uses' => 'UserController@userId'
58
+	]);
59 59
   });
60 60
 });
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 /** @var \Laravel\Lumen\Routing\Router $router */
4 4
 $router = app('router');
5 5
 
6
-$router->group(['namespace' => 'Tfboe\FmLib\Http\Controllers'], function () use ($router) {
6
+$router->group(['namespace' => 'Tfboe\FmLib\Http\Controllers'], function() use ($router) {
7 7
   /**
8 8
    * @api {post} /register Register
9 9
    * @apiVersion 0.1.0
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     'as' => 'login', 'uses' => 'UserController@login'
43 43
   ]);
44 44
 
45
-  $router->group(['middleware' => 'auth:api'], function () use ($router) {
45
+  $router->group(['middleware' => 'auth:api'], function() use ($router) {
46 46
     /**
47 47
      * @api {get} /userId Get User ID
48 48
      * @apiUse AuthenticatedRequest
Please login to merge, or discard this patch.
src/Helpers/Logging.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -38,20 +38,20 @@
 block discarded – undo
38 38
    */
39 39
   public static function log(string $message, string $logger = Logs::GENERAL, int $type = Logger::INFO)
40 40
   {
41
-    if (self::$testing && $logger !== Logs::TESTING) {
42
-      //do nothing
43
-      return;
44
-    }
45
-    Logs::ensureValidValue($logger);
46
-    if (!array_key_exists($logger, self::$loggers)) {
47
-      self::$loggers[$logger] = new Logger($logger);
48
-      // InvalidArgumentException => stream is a string
49
-      // Exception => path is static and it is ensured that it is valid
50
-      /** @noinspection PhpUnhandledExceptionInspection */
51
-      self::$loggers[$logger]->pushHandler(
52
-        new StreamHandler((self::$storagePathFunction)() . '/logs/' . $logger . '.log'));
53
-    }
54
-    self::$loggers[$logger]->log($type, $message);
41
+	if (self::$testing && $logger !== Logs::TESTING) {
42
+	  //do nothing
43
+	  return;
44
+	}
45
+	Logs::ensureValidValue($logger);
46
+	if (!array_key_exists($logger, self::$loggers)) {
47
+	  self::$loggers[$logger] = new Logger($logger);
48
+	  // InvalidArgumentException => stream is a string
49
+	  // Exception => path is static and it is ensured that it is valid
50
+	  /** @noinspection PhpUnhandledExceptionInspection */
51
+	  self::$loggers[$logger]->pushHandler(
52
+		new StreamHandler((self::$storagePathFunction)() . '/logs/' . $logger . '.log'));
53
+	}
54
+	self::$loggers[$logger]->log($type, $message);
55 55
   }
56 56
 //</editor-fold desc="Public Methods">
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 /**
4 4
  * Created by PhpStorm.
5 5
  * User: benedikt
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
    * @param int $type the type of the message
37 37
    * @throws \Tfboe\FmLib\Exceptions\ValueNotValid invalid logger
38 38
    */
39
-  public static function log(string $message, string $logger = Logs::GENERAL, int $type = Logger::INFO)
39
+  public static function log( string $message, string $logger = Logs::GENERAL, int $type = Logger::INFO )
40 40
   {
41
-    if (self::$testing && $logger !== Logs::TESTING) {
41
+    if ( self::$testing && $logger !== Logs::TESTING ) {
42 42
       //do nothing
43 43
       return;
44 44
     }
45 45
     Logs::ensureValidValue($logger);
46
-    if (!array_key_exists($logger, self::$loggers)) {
46
+    if ( !array_key_exists($logger, self::$loggers) ) {
47 47
       self::$loggers[$logger] = new Logger($logger);
48 48
       // InvalidArgumentException => stream is a string
49 49
       // Exception => path is static and it is ensured that it is valid
50 50
       /** @noinspection PhpUnhandledExceptionInspection */
51 51
       self::$loggers[$logger]->pushHandler(
52
-        new StreamHandler((self::$storagePathFunction)() . '/logs/' . $logger . '.log'));
52
+        new StreamHandler((self::$storagePathFunction)().'/logs/'.$logger.'.log'));
53 53
     }
54 54
     self::$loggers[$logger]->log($type, $message);
55 55
   }
Please login to merge, or discard this patch.
src/Helpers/Logs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 /**
4 4
  * Created by PhpStorm.
5 5
  * User: benedikt
Please login to merge, or discard this patch.