Skip to content

Commit 421f8ce

Browse files
committed
Remove deprecated functions/classes
1 parent e8e5737 commit 421f8ce

File tree

9 files changed

+5
-355
lines changed

9 files changed

+5
-355
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ 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`
1823

1924
## 5.x
2025

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

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

src/GraphNode/GraphObject.php

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

src/GraphNode/GraphObjectFactory.php

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

src/Response.php

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -253,24 +253,6 @@ public function decodeBody()
253253
}
254254
}
255255

256-
/**
257-
* Instantiate a new GraphObject from response.
258-
*
259-
* @param null|string $subclassName the GraphNode subclass to cast to
260-
*
261-
* @throws SDKException
262-
*
263-
* @return \Facebook\GraphNode\GraphObject
264-
*
265-
* @deprecated 5.0.0 getGraphObject() has been renamed to getGraphNode()
266-
*
267-
* @todo v6: Remove this method
268-
*/
269-
public function getGraphObject($subclassName = null)
270-
{
271-
return $this->getGraphNode($subclassName);
272-
}
273-
274256
/**
275257
* Instantiate a new GraphNode from response.
276258
*
@@ -371,25 +353,6 @@ public function getGraphGroup()
371353
return $factory->makeGraphGroup();
372354
}
373355

374-
/**
375-
* Instantiate a new GraphList from response.
376-
*
377-
* @param null|string $subclassName the GraphNode subclass to cast list items to
378-
* @param bool $auto_prefix toggle to auto-prefix the subclass name
379-
*
380-
* @throws SDKException
381-
*
382-
* @return \Facebook\GraphNode\GraphList
383-
*
384-
* @deprecated 5.0.0 getGraphList() has been renamed to getGraphEdge()
385-
*
386-
* @todo v6: Remove this method
387-
*/
388-
public function getGraphList($subclassName = null, $auto_prefix = true)
389-
{
390-
return $this->getGraphEdge($subclassName, $auto_prefix);
391-
}
392-
393356
/**
394357
* Instantiate a new GraphEdge from response.
395358
*

tests/GraphNode/CollectionTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public function testAnExistingPropertyCanBeAccessed()
3333

3434
$field = $graphNode->getField('foo');
3535
$this->assertEquals('bar', $field);
36-
37-
// @todo v6: Remove this assertion
38-
$property = $graphNode->getProperty('foo');
39-
$this->assertEquals('bar', $property);
4036
}
4137

4238
public function testAMissingPropertyWillReturnNull()
@@ -53,10 +49,6 @@ public function testAMissingPropertyWillReturnTheDefault()
5349

5450
$field = $graphNode->getField('baz', 'faz');
5551
$this->assertEquals('faz', $field);
56-
57-
// @todo v6: Remove this assertion
58-
$property = $graphNode->getProperty('baz', 'faz');
59-
$this->assertEquals('faz', $property);
6052
}
6153

6254
public function testFalseDefaultsWillReturnSameType()
@@ -83,10 +75,6 @@ public function testTheKeysFromTheCollectionCanBeReturned()
8375

8476
$fieldNames = $graphNode->getFieldNames();
8577
$this->assertEquals(['key1', 'key2', 'key3'], $fieldNames);
86-
87-
// @todo v6: Remove this assertion
88-
$propertyNames = $graphNode->getPropertyNames();
89-
$this->assertEquals(['key1', 'key2', 'key3'], $propertyNames);
9078
}
9179

9280
public function testAnArrayCanBeInjectedViaTheConstructor()

0 commit comments

Comments
 (0)