Skip to content

Commit 7cf460c

Browse files
committed
Rename graphObjectMap to graphNodeMap
1 parent 421f8ce commit 7cf460c

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Starting with version 5, the Facebook PHP SDK follows [SemVer](http://semver.org
2020
- Removed functions `GraphNode::getPropertyNames`, `GraphEdge::getPropertyNames`
2121
- Removed functions `GraphNode::getPropertyNames`, `GraphEdge::getPropertyNames`
2222
- Removed functions `Response::getGraphObject`, `Response::getGraphList`
23+
- Rename function `GraphNode::getObjectMap` to `GraphNode::getNodeMap`
2324

2425
## 5.x
2526

src/GraphNode/GraphAchievement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GraphAchievement extends GraphNode
3030
/**
3131
* @var array maps object key names to Graph object types
3232
*/
33-
protected static $graphObjectMap = [
33+
protected static $graphNodeMap = [
3434
'from' => GraphUser::class,
3535
'application' => GraphApplication::class,
3636
];

src/GraphNode/GraphAlbum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class GraphAlbum extends GraphNode
3131
/**
3232
* @var array maps object key names to Graph object types
3333
*/
34-
protected static $graphObjectMap = [
34+
protected static $graphNodeMap = [
3535
'from' => GraphUser::class,
3636
'place' => GraphPage::class,
3737
];

src/GraphNode/GraphEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GraphEvent extends GraphNode
3030
/**
3131
* @var array maps object key names to GraphNode types
3232
*/
33-
protected static $graphObjectMap = [
33+
protected static $graphNodeMap = [
3434
'cover' => GraphCoverPhoto::class,
3535
'place' => GraphPage::class,
3636
'picture' => GraphPicture::class,

src/GraphNode/GraphGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GraphGroup extends GraphNode
3030
/**
3131
* @var array maps object key names to GraphNode types
3232
*/
33-
protected static $graphObjectMap = [
33+
protected static $graphNodeMap = [
3434
'cover' => GraphCoverPhoto::class,
3535
'venue' => GraphLocation::class,
3636
];

src/GraphNode/GraphNode.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GraphNode extends Collection
3030
/**
3131
* @var array maps object key names to Graph object types
3232
*/
33-
protected static $graphObjectMap = [];
33+
protected static $graphNodeMap = [];
3434

3535
/**
3636
* Init this Graph object.
@@ -184,12 +184,12 @@ public function castToBirthday($value)
184184
}
185185

186186
/**
187-
* Getter for $graphObjectMap.
187+
* Getter for $graphNodeMap.
188188
*
189189
* @return array
190190
*/
191-
public static function getObjectMap()
191+
public static function getNodeMap()
192192
{
193-
return static::$graphObjectMap;
193+
return static::$graphNodeMap;
194194
}
195195
}

src/GraphNode/GraphNodeFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ public function safelyMakeGraphNode(array $data, $subclassName = null)
265265
foreach ($data as $k => $v) {
266266
// Array means could be recurable
267267
if (is_array($v)) {
268-
// Detect any smart-casting from the $graphObjectMap array.
268+
// Detect any smart-casting from the $graphNodeMap array.
269269
// This is always empty on the GraphNode collection, but subclasses can define
270270
// their own array of smart-casting types.
271-
$graphObjectMap = $subclassName::getObjectMap();
272-
$objectSubClass = isset($graphObjectMap[$k])
273-
? $graphObjectMap[$k]
271+
$graphNodeMap = $subclassName::getNodeMap();
272+
$objectSubClass = isset($graphNodeMap[$k])
273+
? $graphNodeMap[$k]
274274
: null;
275275

276276
// Could be a GraphEdge or GraphNode

src/GraphNode/GraphPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GraphPage extends GraphNode
3030
/**
3131
* @var array maps object key names to Graph object types
3232
*/
33-
protected static $graphObjectMap = [
33+
protected static $graphNodeMap = [
3434
'best_page' => GraphPage::class,
3535
'global_brand_parent_page' => GraphPage::class,
3636
'location' => GraphLocation::class,

src/GraphNode/GraphUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GraphUser extends GraphNode
3030
/**
3131
* @var array maps object key names to Graph object types
3232
*/
33-
protected static $graphObjectMap = [
33+
protected static $graphNodeMap = [
3434
'hometown' => GraphPage::class,
3535
'location' => GraphPage::class,
3636
'significant_other' => GraphUser::class,

tests/Fixtures/MyFooGraphNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class MyFooGraphNode extends GraphNode
2828
{
29-
protected static $graphObjectMap = [
29+
protected static $graphNodeMap = [
3030
'foo_object' => MyFooSubClassGraphNode::class,
3131
];
3232
}

0 commit comments

Comments
 (0)