@@ -57,6 +57,7 @@ class Factory
57
57
* Constructor.
58
58
*
59
59
* @param \Illuminate\Http\Request $request
60
+ *
60
61
* @return void
61
62
*/
62
63
public function __construct (Request $ request )
@@ -69,16 +70,13 @@ public function __construct(Request $request)
69
70
*
70
71
* @param string $name
71
72
* @param mixed $value
73
+ *
72
74
* @return \Tymon\JWTAuth\Claims\Claim
73
75
*/
74
76
public function get ($ name , $ value )
75
77
{
76
78
if ($ this ->has ($ name )) {
77
- $ claim = new $ this ->classMap [$ name ]($ value );
78
-
79
- return method_exists ($ claim , 'setLeeway ' ) ?
80
- $ claim ->setLeeway ($ this ->leeway ) :
81
- $ claim ;
79
+ return new $ this ->classMap [$ name ]($ value , $ this ->leeway );
82
80
}
83
81
84
82
return new Custom ($ name , $ value );
@@ -88,6 +86,7 @@ public function get($name, $value)
88
86
* Check whether the claim exists.
89
87
*
90
88
* @param string $name
89
+ *
91
90
* @return bool
92
91
*/
93
92
public function has ($ name )
@@ -99,6 +98,7 @@ public function has($name)
99
98
* Generate the initial value and return the Claim instance.
100
99
*
101
100
* @param string $name
101
+ *
102
102
* @return \Tymon\JWTAuth\Claims\Claim
103
103
*/
104
104
public function make ($ name )
@@ -161,6 +161,7 @@ public function jti()
161
161
*
162
162
* @param string $name
163
163
* @param string $classPath
164
+ *
164
165
* @return $this
165
166
*/
166
167
public function extend ($ name , $ classPath )
@@ -174,6 +175,7 @@ public function extend($name, $classPath)
174
175
* Set the request instance.
175
176
*
176
177
* @param \Illuminate\Http\Request $request
178
+ *
177
179
* @return $this
178
180
*/
179
181
public function setRequest (Request $ request )
@@ -187,6 +189,7 @@ public function setRequest(Request $request)
187
189
* Set the token ttl (in minutes).
188
190
*
189
191
* @param int $ttl
192
+ *
190
193
* @return $this
191
194
*/
192
195
public function setTTL ($ ttl )
@@ -210,6 +213,7 @@ public function getTTL()
210
213
* Set the leeway in seconds.
211
214
*
212
215
* @param int $leeway
216
+ *
213
217
* @return $this
214
218
*/
215
219
public function setLeeway ($ leeway )
0 commit comments