Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
7a4c1cd3
Commit
7a4c1cd3
authored
Dec 23, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trait "ClientTrait" converted into "BaseClient" class.
parent
8abd201b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
25 deletions
+10
-25
BaseClient.php
extensions/yii/authclient/BaseClient.php
+3
-2
BaseOAuth.php
extensions/yii/authclient/BaseOAuth.php
+1
-4
OpenId.php
extensions/yii/authclient/OpenId.php
+1
-4
BaseClientTest.php
tests/unit/extensions/authclient/BaseClientTest.php
+3
-7
CollectionTest.php
tests/unit/extensions/authclient/CollectionTest.php
+2
-8
No files found.
extensions/yii/authclient/
ClientTrai
t.php
→
extensions/yii/authclient/
BaseClien
t.php
View file @
7a4c1cd3
...
@@ -8,11 +8,12 @@
...
@@ -8,11 +8,12 @@
namespace
yii\authclient
;
namespace
yii\authclient
;
use
Yii
;
use
Yii
;
use
yii\base\Component
;
use
yii\base\NotSupportedException
;
use
yii\base\NotSupportedException
;
use
yii\helpers\StringHelper
;
use
yii\helpers\StringHelper
;
/**
/**
*
ProviderTrait can be used to satisfy [[ClientInterface]] interface
.
*
BaseClient is a base Auth Client class
.
*
*
* @see ClientInterface
* @see ClientInterface
*
*
...
@@ -27,7 +28,7 @@ use yii\helpers\StringHelper;
...
@@ -27,7 +28,7 @@ use yii\helpers\StringHelper;
* @author Paul Klimov <klimov.paul@gmail.com>
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
trait
ClientTrait
abstract
class
BaseClient
extends
Component
implements
ClientInterface
{
{
/**
/**
* @var string auth service id.
* @var string auth service id.
...
...
extensions/yii/authclient/BaseOAuth.php
View file @
7a4c1cd3
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
namespace
yii\authclient
;
namespace
yii\authclient
;
use
yii\base\Component
;
use
yii\base\Exception
;
use
yii\base\Exception
;
use
yii\base\InvalidParamException
;
use
yii\base\InvalidParamException
;
use
Yii
;
use
Yii
;
...
@@ -21,10 +20,8 @@ use yii\helpers\Json;
...
@@ -21,10 +20,8 @@ use yii\helpers\Json;
* @author Paul Klimov <klimov.paul@gmail.com>
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
abstract
class
BaseOAuth
extends
Compon
ent
implements
ClientInterface
abstract
class
BaseOAuth
extends
BaseCli
ent
implements
ClientInterface
{
{
use
ClientTrait
;
const
CONTENT_TYPE_JSON
=
'json'
;
// JSON format
const
CONTENT_TYPE_JSON
=
'json'
;
// JSON format
const
CONTENT_TYPE_URLENCODED
=
'urlencoded'
;
// urlencoded query string, like name1=value1&name2=value2
const
CONTENT_TYPE_URLENCODED
=
'urlencoded'
;
// urlencoded query string, like name1=value1&name2=value2
const
CONTENT_TYPE_XML
=
'xml'
;
// XML format
const
CONTENT_TYPE_XML
=
'xml'
;
// XML format
...
...
extensions/yii/authclient/OpenId.php
View file @
7a4c1cd3
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
namespace
yii\authclient
;
namespace
yii\authclient
;
use
yii\base\Component
;
use
yii\base\Exception
;
use
yii\base\Exception
;
use
yii\base\NotSupportedException
;
use
yii\base\NotSupportedException
;
...
@@ -25,10 +24,8 @@ use yii\base\NotSupportedException;
...
@@ -25,10 +24,8 @@ use yii\base\NotSupportedException;
* @author Paul Klimov <klimov.paul@gmail.com>
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
class
OpenId
extends
Compon
ent
implements
ClientInterface
class
OpenId
extends
BaseCli
ent
implements
ClientInterface
{
{
use
ClientTrait
;
/**
/**
* @var array list of attributes, which should be requested from server.
* @var array list of attributes, which should be requested from server.
*/
*/
...
...
tests/unit/extensions/authclient/
ClientTrai
tTest.php
→
tests/unit/extensions/authclient/
BaseClien
tTest.php
View file @
7a4c1cd3
...
@@ -2,11 +2,9 @@
...
@@ -2,11 +2,9 @@
namespace
yiiunit\extensions\authclient
;
namespace
yiiunit\extensions\authclient
;
use
yii\authclient\ClientInterface
;
use
yii\authclient\BaseClient
;
use
yii\authclient\ClientTrait
;
use
yii\base\Object
;
class
ClientTrai
tTest
extends
TestCase
class
BaseClien
tTest
extends
TestCase
{
{
public
function
testSetGet
()
public
function
testSetGet
()
{
{
...
@@ -79,7 +77,6 @@ class ClientTraitTest extends TestCase
...
@@ -79,7 +77,6 @@ class ClientTraitTest extends TestCase
}
}
}
}
class
Client
extends
Object
implements
ClientInterface
class
Client
extends
BaseClient
{
{
use
ClientTrait
;
}
}
\ No newline at end of file
tests/unit/extensions/authclient/CollectionTest.php
View file @
7a4c1cd3
...
@@ -3,9 +3,7 @@
...
@@ -3,9 +3,7 @@
namespace
yiiunit\extensions\authclient
;
namespace
yiiunit\extensions\authclient
;
use
yii\authclient\Collection
;
use
yii\authclient\Collection
;
use
yii\authclient\ClientInterface
;
use
yii\authclient\BaseClient
;
use
yii\authclient\ClientTrait
;
use
yii\base\Object
;
use
yiiunit\extensions\authclient\TestCase
;
use
yiiunit\extensions\authclient\TestCase
;
class
CollectionTest
extends
TestCase
class
CollectionTest
extends
TestCase
...
@@ -82,9 +80,6 @@ class CollectionTest extends TestCase
...
@@ -82,9 +80,6 @@ class CollectionTest extends TestCase
}
}
}
}
class
TestClient
extends
Object
implements
ClientInterface
class
TestClient
extends
BaseClient
{
{
use
ClientTrait
;
public
function
authenticate
()
{}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment