Renamed namespace Util > Utils

This commit is contained in:
Alex Bilbie 2015-04-04 15:42:12 +01:00
parent 027971776b
commit a73322fb43
5 changed files with 51 additions and 10 deletions

View File

@ -9,7 +9,7 @@
* @link https://github.com/thephpleague/oauth2-server * @link https://github.com/thephpleague/oauth2-server
*/ */
namespace League\OAuth2\Server\Util\KeyAlgorithm; namespace League\OAuth2\Server\Utils\KeyAlgorithm;
class DefaultAlgorithm implements KeyAlgorithmInterface class DefaultAlgorithm implements KeyAlgorithmInterface
{ {

View File

@ -9,7 +9,7 @@
* @link https://github.com/thephpleague/oauth2-server * @link https://github.com/thephpleague/oauth2-server
*/ */
namespace League\OAuth2\Server\Util\KeyAlgorithm; namespace League\OAuth2\Server\Utils\KeyAlgorithm;
interface KeyAlgorithmInterface interface KeyAlgorithmInterface
{ {

View File

@ -9,7 +9,7 @@
* @link https://github.com/thephpleague/oauth2-server * @link https://github.com/thephpleague/oauth2-server
*/ */
namespace League\OAuth2\Server\Util; namespace League\OAuth2\Server\Utils;
/** /**
* RedirectUri class * RedirectUri class
@ -21,14 +21,14 @@ class RedirectUri
* *
* @param string $uri The base URI * @param string $uri The base URI
* @param array $params The query string parameters * @param array $params The query string parameters
* @param string $queryDelimeter The query string delimeter (default: "?") * @param string $queryDelimiter The query string delimiter (default: "?")
* *
* @return string The updated URI * @return string The updated URI
*/ */
public static function make($uri, $params = [], $queryDelimeter = '?') public static function make($uri, $params = [], $queryDelimiter = '?')
{ {
$uri .= (strstr($uri, $queryDelimeter) === false) ? $queryDelimeter : '&'; $uri .= (strstr($uri, $queryDelimiter) === false) ? $queryDelimiter : '&';
return $uri.http_build_query($params); return $uri . http_build_query($params);
} }
} }

View File

@ -9,16 +9,19 @@
* @link http://github.com/php-loep/oauth2-server * @link http://github.com/php-loep/oauth2-server
*/ */
namespace League\OAuth2\Server\Util; namespace League\OAuth2\Server\Utils;
use League\OAuth2\Server\Util\KeyAlgorithm\DefaultAlgorithm; use League\OAuth2\Server\Utils\KeyAlgorithm\DefaultAlgorithm;
use League\OAuth2\Server\Util\KeyAlgorithm\KeyAlgorithmInterface; use League\OAuth2\Server\Utils\KeyAlgorithm\KeyAlgorithmInterface;
/** /**
* SecureKey class * SecureKey class
*/ */
class SecureKey class SecureKey
{ {
/**
* @var KeyAlgorithmInterface
*/
protected static $algorithm; protected static $algorithm;
/** /**

View File

@ -0,0 +1,38 @@
<?php
namespace League\OAuth2\Server\Utils;
use League\OAuth2\Server\AbstractServer;
trait ServerAwareTrait
{
/**
* Server
*
* @var \League\OAuth2\Server\AbstractServer $server
*/
protected $server;
/**
* Set the server
*
* @param \League\OAuth2\Server\AbstractServer $server
*
* @return self
*/
public function setServer(AbstractServer $server)
{
$this->server = $server;
return $this;
}
/**
* Return the server
*
* @return \League\OAuth2\Server\AbstractServer
*/
protected function getServer()
{
return $this->server;
}
}