Skip to content

Commit d0b5f06

Browse files
authored
Merge pull request facebookarchive#901 from yguedidi/remove_deprecation
Remove deprecation
2 parents e8e5737 + bf0d761 commit d0b5f06

19 files changed

+29
-378
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Starting with version 5, the Facebook PHP SDK follows [SemVer](http://semver.org
1515
- Removed option `http_client_handler`
1616
- Added option `http_client` which should be an object implementing `\Http\Client\HttpClient`
1717
- Removed functions `FacebookClient::setHttpClientHandler()` and `FacebookClient::getHttpClientHandler()` in favor for `FacebookClient::getHttpClient()` and `FacebookClient::setHttpClient()`.
18+
- Removed classes `GraphObject`, `GraphList` and `GraphObjectFactory`
19+
- Removed functions `AccessTokenMetadata::getProperty`, `GraphNode::getProperty`, `GraphEdge::getProperty`
20+
- Removed functions `GraphNode::getPropertyNames`, `GraphEdge::getPropertyNames`
21+
- Removed functions `GraphNode::getPropertyNames`, `GraphEdge::getPropertyNames`
22+
- Removed functions `Response::getGraphObject`, `Response::getGraphList`
23+
- Rename function `GraphNode::getObjectMap` to `GraphNode::getNodeMap`
1824

1925
## 5.x
2026

src/Authentication/AccessTokenMetadata.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,6 @@ public function getField($field, $default = null)
8080
return $default;
8181
}
8282

83-
/**
84-
* Returns a value from the metadata.
85-
*
86-
* @param string $field the property to retrieve
87-
* @param mixed $default the default to return if the property doesn't exist
88-
*
89-
* @return mixed
90-
*
91-
* @deprecated 5.0.0 getProperty() has been renamed to getField()
92-
*
93-
* @todo v6: Remove this method
94-
*/
95-
public function getProperty($field, $default = null)
96-
{
97-
return $this->getField($field, $default);
98-
}
99-
10083
/**
10184
* Returns a value from a child property in the metadata.
10285
*

src/GraphNode/Collection.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,6 @@ public function getField($name, $default = null)
6969
return $default;
7070
}
7171

72-
/**
73-
* Gets the value of the named property for this graph object.
74-
*
75-
* @param string $name the property to retrieve
76-
* @param mixed $default the default to return if the property doesn't exist
77-
*
78-
* @return mixed
79-
*
80-
* @deprecated 5.0.0 getProperty() has been renamed to getField()
81-
*
82-
* @todo v6: Remove this method
83-
*/
84-
public function getProperty($name, $default = null)
85-
{
86-
return $this->getField($name, $default);
87-
}
88-
8972
/**
9073
* Returns a list of all fields set on the object.
9174
*
@@ -96,20 +79,6 @@ public function getFieldNames()
9679
return array_keys($this->items);
9780
}
9881

99-
/**
100-
* Returns a list of all properties set on the object.
101-
*
102-
* @return array
103-
*
104-
* @deprecated 5.0.0 getPropertyNames() has been renamed to getFieldNames()
105-
*
106-
* @todo v6: Remove this method
107-
*/
108-
public function getPropertyNames()
109-
{
110-
return $this->getFieldNames();
111-
}
112-
11382
/**
11483
* Get all of the items in the collection.
11584
*

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/GraphList.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

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

0 commit comments

Comments
 (0)