Skip to content

Commit

Permalink
Finished renaming of classes to remove the OAuth prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Dec 17, 2011
1 parent 3f02efd commit e56a5dc
Show file tree
Hide file tree
Showing 41 changed files with 229 additions and 240 deletions.
9 changes: 9 additions & 0 deletions Document/AccessToken.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\AccessToken as BaseAccessToken;

class AccessToken extends BaseAccessToken
{
}
10 changes: 10 additions & 0 deletions Document/AccessTokenManager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\AccessTokenManagerInterface;

class AccessTokenManager extends TokenManager implements AccessTokenManagerInterface
{
}

4 changes: 2 additions & 2 deletions Document/OAuth2AuthCode.php → Document/AuthCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\OAuth2AuthCode as BaseOAuth2AuthCode;
use FOS\OAuthServerBundle\Model\AuthCode as BaseAuthCode;

/**
* @author Richard Fullmer <[email protected]>
*/
class OAuth2AuthCode extends BaseOAuth2AuthCode
class AuthCode extends BaseAuthCode
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\OAuth2AuthCodeManager as BaseOAuth2AuthCodeManager;
use FOS\OAuthServerBundle\Model\OAuth2AuthCodeInterface;
use FOS\OAuthServerBundle\Model\AuthCodeManager as BaseAuthCodeManager;
use FOS\OAuthServerBundle\Model\AuthCodeInterface;
use Doctrine\ODM\MongoDB\DocumentManager;

class OAuth2AuthCodeManager extends BaseOAuth2AuthCodeManager
class AuthCodeManager extends BaseAuthCodeManager
{
protected $dm;

Expand Down Expand Up @@ -34,14 +34,14 @@ function getClass()
*/
function findAuthCodeBy(array $criteria)
{
return $this->dm->findOneBy($criteria);
return $this->repository->findOneBy($criteria);
}

/**
* @param OAuth2AuthCodeInterface $authCode
* @param bool $andFlush
* @param AuthCodeInterface $authCode
* @param boolean $andFlush
*/
function updateAuthCode(OAuth2AuthCodeInterface $authCode, $andFlush = true)
function updateAuthCode(AuthCodeInterface $authCode, $andFlush = true)
{
$this->dm->persist($authCode);

Expand All @@ -50,7 +50,7 @@ function updateAuthCode(OAuth2AuthCodeInterface $authCode, $andFlush = true)
}
}

function deleteAuthCode(OAuth2AuthCodeInterface $authCode)
function deleteAuthCode(AuthCodeInterface $authCode)
{
$this->dm->remove($authCode);
$this->dm->flush();
Expand Down
10 changes: 10 additions & 0 deletions Document/Client.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\Client as BaseClient;

class Client extends BaseClient
{
}

12 changes: 6 additions & 6 deletions Document/OAuth2ClientManager.php → Document/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\OAuth2ClientManager as BaseOAuth2ClientManager;
use FOS\OAuthServerBundle\Model\ClientManager as BaseClientManager;
use Doctrine\ODM\MongoDB\DocumentManager;
use FOS\OAuthServerBundle\Model\OAuth2ClientInterface;
use FOS\OAuthServerBundle\Model\ClientInterface;

class OAuth2ClientManager extends BaseOAuth2ClientManager
class ClientManager extends BaseClientManager
{
protected $dm;

Expand All @@ -31,16 +31,16 @@ public function findClientBy(array $criteria)
return $this->repository->findOneBy($criteria);
}

public function updateClient(OAuth2ClientInterface $client, $andFlush = true)
public function updateClient(ClientInterface $client, $andFlush = true)
{
$this->dm->persist($client);

if ($andFlush) {
$this->dm->flush();
}
}

public function deleteClient(OAuth2ClientInterface $client)
public function deleteClient(ClientInterface $client)
{
$this->dm->remove($client);
$this->dm->flush();
Expand Down
9 changes: 0 additions & 9 deletions Document/OAuth2AccessToken.php

This file was deleted.

11 changes: 0 additions & 11 deletions Document/OAuth2AccessTokenManager.php

This file was deleted.

10 changes: 0 additions & 10 deletions Document/OAuth2Client.php

This file was deleted.

10 changes: 5 additions & 5 deletions Document/OAuth2TokenManager.php → Document/TokenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace FOS\OAuthServerBundle\Document;

use FOS\OAuthServerBundle\Model\OAuth2TokenManager as BaseOAuth2TokenManager;
use FOS\OAuthServerBundle\Model\TokenManager as BaseTokenManager;
use Doctrine\ODM\MongoDB\DocumentManager;
use FOS\OAuthServerBundle\Model\OAuth2TokenInterface;
use FOS\OAuthServerBundle\Model\TokenInterface;

class OAuth2TokenManager extends BaseOAuth2TokenManager
class TokenManager extends BaseTokenManager
{
protected $dm;

Expand All @@ -31,7 +31,7 @@ public function findTokenBy(array $criteria)
return $this->repository->findOneBy($criteria);
}

public function updateToken(OAuth2TokenInterface $token, $andFlush = true)
public function updateToken(TokenInterface $token, $andFlush = true)
{
$this->dm->persist($token);

Expand All @@ -40,7 +40,7 @@ public function updateToken(OAuth2TokenInterface $token, $andFlush = true)
}
}

public function deleteToken(OAuth2TokenInterface $token)
public function deleteToken(TokenInterface $token)
{
$this->dm->remove($token);
$this->dm->flush();
Expand Down
5 changes: 2 additions & 3 deletions Entity/AccessTokenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@

namespace FOS\OAuthServerBundle\Entity;

use FOS\OAuthServerBundle\Entity\OAuthTokenManager;
use FOS\OAuthServerBundle\Model\OAuthAccessTokenManagerInterface;
use FOS\OAuthServerBundle\Model\AccessTokenManagerInterface;

class OAuthAccessTokenManager extends OAuthTokenManager implements OAuthAccessTokenManagerInterface
class OAuthAccessTokenManager extends TokenManager implements AccessTokenManagerInterface
{
}
4 changes: 2 additions & 2 deletions Entity/AuthCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

namespace FOS\OAuthServerBundle\Entity;

use FOS\OAuthServerBundle\Model\OAuthAuthCode as BaseOAuthAuthCode;
use FOS\OAuthServerBundle\Model\AuthCode as BaseAuthCode;

class OAuthAuthCode extends BaseOAuthAuthCode
class AuthCode extends BaseAuthCode
{
}
2 changes: 0 additions & 2 deletions Entity/AuthCodeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
namespace FOS\OAuthServerBundle\Entity;

use Doctrine\ORM\EntityManager;

use FOS\OAuthServerBundle\Entity\TokenManager;
use FOS\OAuthServerBundle\Model\AuthCodeManager as BaseAuthCodeManager;
use FOS\OAuthServerBundle\Model\AuthCodeInterface;

Expand Down
2 changes: 1 addition & 1 deletion Entity/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace FOS\OAuthServerBundle\Entity;

se Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManager;
use FOS\OAuthServerBundle\Model\ClientManager as BaseClientManager;
use FOS\OAuthServerBundle\Model\ClientInterface;

Expand Down
4 changes: 2 additions & 2 deletions FOSOAuthServerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace FOS\OAuthServerBundle;

use FOS\OAuthServerBundle\DependencyInjection\Security\Factory\OAuth2Factory;
use FOS\OAuthServerBundle\DependencyInjection\Security\Factory\OAuthFactory;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand All @@ -24,7 +24,7 @@ public function build(ContainerBuilder $container)

$extension = $container->getExtension('security');
if (method_exists($extension, 'addSecurityListenerFactory')) {
$extension->addSecurityListenerFactory(new OAuth2Factory);
$extension->addSecurityListenerFactory(new OAuthFactory);
}
}
}
7 changes: 7 additions & 0 deletions Model/AccessToken.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace FOS\OAuthServerBundle\Model;

class AccessToken extends Token implements AccessTokenInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

use OAuth2\Model\IOAuth2AccessToken;

interface OAuthAccessTokenInterface extends OAuthTokenInterface, IOAuth2AccessToken
interface AccessTokenInterface extends TokenInterface, IOAuth2AccessToken
{
}
8 changes: 8 additions & 0 deletions Model/AccessTokenManagerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace FOS\OAuthServerBundle\Model;

interface AccessTokenManagerInterface extends TokenManagerInterface
{
}

2 changes: 1 addition & 1 deletion Model/OAuth2AuthCode.php → Model/AuthCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* @author Richard Fullmer <[email protected]>
*/
class OAuth2AuthCode extends OAuth2Token implements OAuth2AuthCodeInterface
class AuthCode extends Token implements AuthCodeInterface
{
protected $redirectUri;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
/**
* @author Richard Fullmer <[email protected]>
*/
interface OAuth2AuthCodeInterface extends OAuth2TokenInterface, IOAuth2AuthCode
interface AuthCodeInterface extends TokenInterface, IOAuth2AuthCode
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace FOS\OAuthServerBundle\Model;

abstract class OAuth2AuthCodeManager implements OAuth2AuthCodeManagerInterface
abstract class AuthCodeManager implements AuthCodeManagerInterface
{
public function createAuthCode()
{
Expand Down
44 changes: 44 additions & 0 deletions Model/AuthCodeManagerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
*
*/

namespace FOS\OAuthServerBundle\Model;

/**
* @author Richard Fullmer <[email protected]>
*/
interface AuthCodeManagerInterface
{
/**
* @return \FOS\OAuthServerBundle\Model\AuthCodeInterface
*/
function createAuthCode();

/**
* @return string
*/
function getClass();

/**
* @param array $criteria
*/
function findAuthCodeBy(array $criteria);

/**
* @param string $token
*
* @return \FOS\OAuthServerBundle\Model\AuthCodeInterface
*/
function findAuthCodeByToken($token);

/**
* @param \FOS\OAuthServerBundle\Model\AuthCodeInterface $authCode
*/
function updateAuthCode(AuthCodeInterface $authCode);

/**
* @param \FOS\OAuthServerBundle\Model\AuthCodeInterface $authCode
*/
function deleteAuthCode(AuthCodeInterface $authCode);
}
2 changes: 1 addition & 1 deletion Model/OAuth2Client.php → Model/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use OAuth2\OAuth2;
use FOS\OAuthServerBundle\Util\Random;

class OAuth2Client implements OAuth2ClientInterface
class Client implements ClientInterface
{
protected $id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use OAuth2\Model\IOAuth2Client;

interface OAuth2ClientInterface extends IOAuth2Client
interface ClientInterface extends IOAuth2Client
{
function getId();

Expand Down
2 changes: 1 addition & 1 deletion Model/OAuth2ClientManager.php → Model/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace FOS\OAuthServerBundle\Model;

abstract class OAuth2ClientManager implements OAuth2ClientManagerInterface
abstract class ClientManager implements ClientManagerInterface
{
public function createClient()
{
Expand Down
19 changes: 19 additions & 0 deletions Model/ClientManagerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace FOS\OAuthServerBundle\Model;

interface ClientManagerInterface
{
function createClient();

function getClass();

function findClientBy(array $criteria);

function findClientByPublicId($publicId);

function updateClient(ClientInterface $client, $andFlush = true);

function deleteClient(ClientInterface $client);
}

Loading

0 comments on commit e56a5dc

Please sign in to comment.