mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Added ability to cast token as a string
This commit is contained in:
		@@ -147,6 +147,19 @@ abstract class AbstractTokenEntity
 | 
				
			|||||||
        return $scopes;
 | 
					        return $scopes;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the token as a string if the object is cast as a string
 | 
				
			||||||
 | 
					     * @return string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function __toString()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (is_null($this->token)) {
 | 
				
			||||||
 | 
					            throw new \BadMethodCallException('Token is null');
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return $this->token;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Expire the token
 | 
					     * Expire the token
 | 
				
			||||||
     * @return void
 | 
					     * @return void
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user