Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 2f14903

Browse files
authored
Merge pull request #727 from localheinz/fix/class
Fix: Use class keyword
2 parents d71fa0f + 4c49397 commit 2f14903

38 files changed

+217
-158
lines changed

src/Facebook/GraphNodes/GraphAchievement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class GraphAchievement extends GraphNode
3434
* @var array Maps object key names to Graph object types.
3535
*/
3636
protected static $graphObjectMap = [
37-
'from' => '\Facebook\GraphNodes\GraphUser',
38-
'application' => '\Facebook\GraphNodes\GraphApplication',
37+
'from' => GraphUser::class,
38+
'application' => GraphApplication::class,
3939
];
4040

4141
/**

src/Facebook/GraphNodes/GraphAlbum.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class GraphAlbum extends GraphNode
3535
* @var array Maps object key names to Graph object types.
3636
*/
3737
protected static $graphObjectMap = [
38-
'from' => '\Facebook\GraphNodes\GraphUser',
39-
'place' => '\Facebook\GraphNodes\GraphPage',
38+
'from' => GraphUser::class,
39+
'place' => GraphPage::class,
4040
];
4141

4242
/**

src/Facebook/GraphNodes/GraphEvent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class GraphEvent extends GraphNode
3434
* @var array Maps object key names to GraphNode types.
3535
*/
3636
protected static $graphObjectMap = [
37-
'cover' => '\Facebook\GraphNodes\GraphCoverPhoto',
38-
'place' => '\Facebook\GraphNodes\GraphPage',
39-
'picture' => '\Facebook\GraphNodes\GraphPicture',
40-
'parent_group' => '\Facebook\GraphNodes\GraphGroup',
37+
'cover' => GraphCoverPhoto::class,
38+
'place' => GraphPage::class,
39+
'picture' => GraphPicture::class,
40+
'parent_group' => GraphGroup::class,
4141
];
4242

4343
/**

src/Facebook/GraphNodes/GraphGroup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class GraphGroup extends GraphNode
3434
* @var array Maps object key names to GraphNode types.
3535
*/
3636
protected static $graphObjectMap = [
37-
'cover' => '\Facebook\GraphNodes\GraphCoverPhoto',
38-
'venue' => '\Facebook\GraphNodes\GraphLocation',
37+
'cover' => GraphCoverPhoto::class,
38+
'venue' => GraphLocation::class,
3939
];
4040

4141
/**

src/Facebook/GraphNodes/GraphNodeFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ class GraphNodeFactory
4545
/**
4646
* @const string The base graph object class.
4747
*/
48-
const BASE_GRAPH_NODE_CLASS = '\Facebook\GraphNodes\GraphNode';
48+
const BASE_GRAPH_NODE_CLASS = GraphNode::class;
4949

5050
/**
5151
* @const string The base graph edge class.
5252
*/
53-
const BASE_GRAPH_EDGE_CLASS = '\Facebook\GraphNodes\GraphEdge';
53+
const BASE_GRAPH_EDGE_CLASS = GraphEdge::class;
5454

5555
/**
5656
* @const string The graph object prefix.

src/Facebook/GraphNodes/GraphObjectFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class GraphObjectFactory extends GraphNodeFactory
3838
/**
3939
* @const string The base graph object class.
4040
*/
41-
const BASE_GRAPH_NODE_CLASS = '\Facebook\GraphNodes\GraphObject';
41+
const BASE_GRAPH_NODE_CLASS = GraphObject::class;
4242

4343
/**
4444
* @const string The base graph edge class.
4545
*/
46-
const BASE_GRAPH_EDGE_CLASS = '\Facebook\GraphNodes\GraphList';
46+
const BASE_GRAPH_EDGE_CLASS = GraphList::class;
4747

4848
/**
4949
* Tries to convert a FacebookResponse entity into a GraphNode.

src/Facebook/GraphNodes/GraphPage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ class GraphPage extends GraphNode
3434
* @var array Maps object key names to Graph object types.
3535
*/
3636
protected static $graphObjectMap = [
37-
'best_page' => '\Facebook\GraphNodes\GraphPage',
38-
'global_brand_parent_page' => '\Facebook\GraphNodes\GraphPage',
39-
'location' => '\Facebook\GraphNodes\GraphLocation',
40-
'cover' => '\Facebook\GraphNodes\GraphCoverPhoto',
41-
'picture' => '\Facebook\GraphNodes\GraphPicture',
37+
'best_page' => GraphPage::class,
38+
'global_brand_parent_page' => GraphPage::class,
39+
'location' => GraphLocation::class,
40+
'cover' => GraphCoverPhoto::class,
41+
'picture' => GraphPicture::class,
4242
];
4343

4444
/**

src/Facebook/GraphNodes/GraphUser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class GraphUser extends GraphNode
3434
* @var array Maps object key names to Graph object types.
3535
*/
3636
protected static $graphObjectMap = [
37-
'hometown' => '\Facebook\GraphNodes\GraphPage',
38-
'location' => '\Facebook\GraphNodes\GraphPage',
39-
'significant_other' => '\Facebook\GraphNodes\GraphUser',
40-
'picture' => '\Facebook\GraphNodes\GraphPicture',
37+
'hometown' => GraphPage::class,
38+
'location' => GraphPage::class,
39+
'significant_other' => GraphUser::class,
40+
'picture' => GraphPicture::class,
4141
];
4242

4343
/**

tests/Authentication/AccessTokenMetadataTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public function testDatesGetCastToDateTime()
5858
$expires = $metadata->getExpiresAt();
5959
$issuedAt = $metadata->getIssuedAt();
6060

61-
$this->assertInstanceOf('DateTime', $expires);
62-
$this->assertInstanceOf('DateTime', $issuedAt);
61+
$this->assertInstanceOf(\DateTime::class, $expires);
62+
$this->assertInstanceOf(\DateTime::class, $issuedAt);
6363
}
6464

6565
public function testAllTheGettersReturnTheProperValue()

tests/Authentication/OAuth2ClientTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
use Facebook\Facebook;
2727
use Facebook\FacebookApp;
2828
use Facebook\Authentication\OAuth2Client;
29+
use Facebook\Authentication\AccessTokenMetadata;
30+
use Facebook\Authentication\AccessToken;
2931

3032
class OAuth2ClientTest extends \PHPUnit_Framework_TestCase
3133
{
@@ -58,7 +60,7 @@ public function testCanGetMetadataFromAnAccessToken()
5860

5961
$metadata = $this->oauth->debugToken('baz_token');
6062

61-
$this->assertInstanceOf('Facebook\Authentication\AccessTokenMetadata', $metadata);
63+
$this->assertInstanceOf(AccessTokenMetadata::class, $metadata);
6264
$this->assertEquals('444', $metadata->getUserId());
6365

6466
$expectedParams = [
@@ -103,7 +105,7 @@ public function testCanGetAccessTokenFromCode()
103105

104106
$accessToken = $this->oauth->getAccessTokenFromCode('bar_code', 'foo_uri');
105107

106-
$this->assertInstanceOf('Facebook\Authentication\AccessToken', $accessToken);
108+
$this->assertInstanceOf(AccessToken::class, $accessToken);
107109
$this->assertEquals('my_access_token', $accessToken->getValue());
108110

109111
$expectedParams = [

0 commit comments

Comments
 (0)