@@ -57,6 +57,7 @@ class Factory
5757 * Constructor.
5858 *
5959 * @param \Illuminate\Http\Request $request
60+ *
6061 * @return void
6162 */
6263 public function __construct (Request $ request )
@@ -69,16 +70,13 @@ public function __construct(Request $request)
6970 *
7071 * @param string $name
7172 * @param mixed $value
73+ *
7274 * @return \Tymon\JWTAuth\Claims\Claim
7375 */
7476 public function get ($ name , $ value )
7577 {
7678 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 );
8280 }
8381
8482 return new Custom ($ name , $ value );
@@ -88,6 +86,7 @@ public function get($name, $value)
8886 * Check whether the claim exists.
8987 *
9088 * @param string $name
89+ *
9190 * @return bool
9291 */
9392 public function has ($ name )
@@ -99,6 +98,7 @@ public function has($name)
9998 * Generate the initial value and return the Claim instance.
10099 *
101100 * @param string $name
101+ *
102102 * @return \Tymon\JWTAuth\Claims\Claim
103103 */
104104 public function make ($ name )
@@ -161,6 +161,7 @@ public function jti()
161161 *
162162 * @param string $name
163163 * @param string $classPath
164+ *
164165 * @return $this
165166 */
166167 public function extend ($ name , $ classPath )
@@ -174,6 +175,7 @@ public function extend($name, $classPath)
174175 * Set the request instance.
175176 *
176177 * @param \Illuminate\Http\Request $request
178+ *
177179 * @return $this
178180 */
179181 public function setRequest (Request $ request )
@@ -187,6 +189,7 @@ public function setRequest(Request $request)
187189 * Set the token ttl (in minutes).
188190 *
189191 * @param int $ttl
192+ *
190193 * @return $this
191194 */
192195 public function setTTL ($ ttl )
@@ -210,6 +213,7 @@ public function getTTL()
210213 * Set the leeway in seconds.
211214 *
212215 * @param int $leeway
216+ *
213217 * @return $this
214218 */
215219 public function setLeeway ($ leeway )
0 commit comments