Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from TomHAnderson/hotfix/entity-namespaces
Browse files Browse the repository at this point in the history
Hotfix/entity namespaces
  • Loading branch information
TomHAnderson committed Apr 27, 2015
2 parents 656f788 + d76c302 commit 54573dc
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 109 deletions.
23 changes: 12 additions & 11 deletions src/Entity/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace ZF\OAuth2\Doctrine\Entity;

use Doctrine\ORM\Mapping as ORM;
use Zend\Stdlib\ArraySerializableInterface;
use Doctrine\Common\Collections\ArrayCollection;

/**
* AccessToken
Expand All @@ -26,7 +26,7 @@ class AccessToken implements ArraySerializableInterface
private $id;

/**
* @var \ZF\OAuth2\Doctrine\Entity\Client
* @var Client
*/
private $client;

Expand All @@ -36,6 +36,7 @@ class AccessToken implements ArraySerializableInterface
private $scope;

/**
* UserInterface
* @var object
*/
private $user;
Expand All @@ -45,7 +46,7 @@ class AccessToken implements ArraySerializableInterface
*/
public function __construct()
{
$this->scope = new \Doctrine\Common\Collections\ArrayCollection();
$this->scope = new ArrayCollection();
}

public function getArrayCopy()
Expand Down Expand Up @@ -156,10 +157,10 @@ public function getId()
/**
* Set client
*
* @param \ZF\OAuth2\Doctrine\Entity\Client $client
* @param Client $client
* @return AccessToken
*/
public function setClient(\ZF\OAuth2\Doctrine\Entity\Client $client)
public function setClient(Client $client)
{
$this->client = $client;

Expand All @@ -169,7 +170,7 @@ public function setClient(\ZF\OAuth2\Doctrine\Entity\Client $client)
/**
* Get client
*
* @return \ZF\OAuth2\Doctrine\Entity\Client
* @return Client
*/
public function getClient()
{
Expand All @@ -179,10 +180,10 @@ public function getClient()
/**
* Add scope
*
* @param \ZF\OAuth2\Doctrine\Entity\Scope $scope
* @param Scope $scope
* @return AccessToken
*/
public function addScope(\ZF\OAuth2\Doctrine\Entity\Scope $scope)
public function addScope(Scope $scope)
{
$this->scope[] = $scope;

Expand All @@ -192,9 +193,9 @@ public function addScope(\ZF\OAuth2\Doctrine\Entity\Scope $scope)
/**
* Remove scope
*
* @param \ZF\OAuth2\Doctrine\Entity\Scope $scope
* @param Scope $scope
*/
public function removeScope(\ZF\OAuth2\Doctrine\Entity\Scope $scope)
public function removeScope(Scope $scope)
{
$this->scope->removeElement($scope);
}
Expand All @@ -215,7 +216,7 @@ public function getScope()
* @param $user
* @return AuthorizationCode
*/
public function setUser($user)
public function setUser(UserInterface $user)
{
$this->user = $user;

Expand Down
23 changes: 12 additions & 11 deletions src/Entity/AuthorizationCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ZF\OAuth2\Doctrine\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
* AuthorizationCode
Expand Down Expand Up @@ -35,7 +35,7 @@ class AuthorizationCode
private $id;

/**
* @var \ZF\OAuth2\Doctrine\Entity\Client
* @var Client
*/
private $client;

Expand All @@ -45,6 +45,7 @@ class AuthorizationCode
private $scope;

/**
* UserInterface
* @var object
*/
private $user;
Expand All @@ -54,7 +55,7 @@ class AuthorizationCode
*/
public function __construct()
{
$this->scope = new \Doctrine\Common\Collections\ArrayCollection();
$this->scope = new ArrayCollection();
}

public function getArrayCopy()
Expand Down Expand Up @@ -217,10 +218,10 @@ public function getId()
/**
* Set client
*
* @param \ZF\OAuth2\Doctrine\Entity\Client $client
* @param Client $client
* @return AuthorizationCode
*/
public function setClient(\ZF\OAuth2\Doctrine\Entity\Client $client)
public function setClient(Client $client)
{
$this->client = $client;

Expand All @@ -230,7 +231,7 @@ public function setClient(\ZF\OAuth2\Doctrine\Entity\Client $client)
/**
* Get client
*
* @return \ZF\OAuth2\Doctrine\Entity\Client
* @return Client
*/
public function getClient()
{
Expand All @@ -240,10 +241,10 @@ public function getClient()
/**
* Add scope
*
* @param \ZF\OAuth2\Doctrine\Entity\Scope $scope
* @param Scope $scope
* @return AuthorizationCode
*/
public function addScope(\ZF\OAuth2\Doctrine\Entity\Scope $scope)
public function addScope(Scope $scope)
{
$this->scope[] = $scope;

Expand All @@ -253,9 +254,9 @@ public function addScope(\ZF\OAuth2\Doctrine\Entity\Scope $scope)
/**
* Remove scope
*
* @param \ZF\OAuth2\Doctrine\Entity\Scope $scope
* @param Scope $scope
*/
public function removeScope(\ZF\OAuth2\Doctrine\Entity\Scope $scope)
public function removeScope(Scope $scope)
{
$this->scope->removeElement($scope);
}
Expand All @@ -276,7 +277,7 @@ public function getScope()
* @param $user
* @return AuthorizationCode
*/
public function setUser($user)
public function setUser(UserInterface $user)
{
$this->user = $user;

Expand Down
Loading

0 comments on commit 54573dc

Please sign in to comment.