Skip to content

Commit

Permalink
Remove deprecated functions/classes
Browse files Browse the repository at this point in the history
  • Loading branch information
yguedidi committed Dec 6, 2017
1 parent e8e5737 commit 421f8ce
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 355 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Starting with version 5, the Facebook PHP SDK follows [SemVer](http:https://semver.org
- Removed option `http_client_handler`
- Added option `http_client` which should be an object implementing `\Http\Client\HttpClient`
- Removed functions `FacebookClient::setHttpClientHandler()` and `FacebookClient::getHttpClientHandler()` in favor for `FacebookClient::getHttpClient()` and `FacebookClient::setHttpClient()`.
- Removed classes `GraphObject`, `GraphList` and `GraphObjectFactory`
- Removed functions `AccessTokenMetadata::getProperty`, `GraphNode::getProperty`, `GraphEdge::getProperty`
- Removed functions `GraphNode::getPropertyNames`, `GraphEdge::getPropertyNames`
- Removed functions `GraphNode::getPropertyNames`, `GraphEdge::getPropertyNames`
- Removed functions `Response::getGraphObject`, `Response::getGraphList`

## 5.x

Expand Down
17 changes: 0 additions & 17 deletions src/Authentication/AccessTokenMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ public function getField($field, $default = null)
return $default;
}

/**
* Returns a value from the metadata.
*
* @param string $field the property to retrieve
* @param mixed $default the default to return if the property doesn't exist
*
* @return mixed
*
* @deprecated 5.0.0 getProperty() has been renamed to getField()
*
* @todo v6: Remove this method
*/
public function getProperty($field, $default = null)
{
return $this->getField($field, $default);
}

/**
* Returns a value from a child property in the metadata.
*
Expand Down
31 changes: 0 additions & 31 deletions src/GraphNode/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,6 @@ public function getField($name, $default = null)
return $default;
}

/**
* Gets the value of the named property for this graph object.
*
* @param string $name the property to retrieve
* @param mixed $default the default to return if the property doesn't exist
*
* @return mixed
*
* @deprecated 5.0.0 getProperty() has been renamed to getField()
*
* @todo v6: Remove this method
*/
public function getProperty($name, $default = null)
{
return $this->getField($name, $default);
}

/**
* Returns a list of all fields set on the object.
*
Expand All @@ -96,20 +79,6 @@ public function getFieldNames()
return array_keys($this->items);
}

/**
* Returns a list of all properties set on the object.
*
* @return array
*
* @deprecated 5.0.0 getPropertyNames() has been renamed to getFieldNames()
*
* @todo v6: Remove this method
*/
public function getPropertyNames()
{
return $this->getFieldNames();
}

/**
* Get all of the items in the collection.
*
Expand Down
34 changes: 0 additions & 34 deletions src/GraphNode/GraphList.php

This file was deleted.

34 changes: 0 additions & 34 deletions src/GraphNode/GraphObject.php

This file was deleted.

74 changes: 0 additions & 74 deletions src/GraphNode/GraphObjectFactory.php

This file was deleted.

37 changes: 0 additions & 37 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,24 +253,6 @@ public function decodeBody()
}
}

/**
* Instantiate a new GraphObject from response.
*
* @param null|string $subclassName the GraphNode subclass to cast to
*
* @throws SDKException
*
* @return \Facebook\GraphNode\GraphObject
*
* @deprecated 5.0.0 getGraphObject() has been renamed to getGraphNode()
*
* @todo v6: Remove this method
*/
public function getGraphObject($subclassName = null)
{
return $this->getGraphNode($subclassName);
}

/**
* Instantiate a new GraphNode from response.
*
Expand Down Expand Up @@ -371,25 +353,6 @@ public function getGraphGroup()
return $factory->makeGraphGroup();
}

/**
* Instantiate a new GraphList from response.
*
* @param null|string $subclassName the GraphNode subclass to cast list items to
* @param bool $auto_prefix toggle to auto-prefix the subclass name
*
* @throws SDKException
*
* @return \Facebook\GraphNode\GraphList
*
* @deprecated 5.0.0 getGraphList() has been renamed to getGraphEdge()
*
* @todo v6: Remove this method
*/
public function getGraphList($subclassName = null, $auto_prefix = true)
{
return $this->getGraphEdge($subclassName, $auto_prefix);
}

/**
* Instantiate a new GraphEdge from response.
*
Expand Down
12 changes: 0 additions & 12 deletions tests/GraphNode/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ public function testAnExistingPropertyCanBeAccessed()

$field = $graphNode->getField('foo');
$this->assertEquals('bar', $field);

// @todo v6: Remove this assertion
$property = $graphNode->getProperty('foo');
$this->assertEquals('bar', $property);
}

public function testAMissingPropertyWillReturnNull()
Expand All @@ -53,10 +49,6 @@ public function testAMissingPropertyWillReturnTheDefault()

$field = $graphNode->getField('baz', 'faz');
$this->assertEquals('faz', $field);

// @todo v6: Remove this assertion
$property = $graphNode->getProperty('baz', 'faz');
$this->assertEquals('faz', $property);
}

public function testFalseDefaultsWillReturnSameType()
Expand All @@ -83,10 +75,6 @@ public function testTheKeysFromTheCollectionCanBeReturned()

$fieldNames = $graphNode->getFieldNames();
$this->assertEquals(['key1', 'key2', 'key3'], $fieldNames);

// @todo v6: Remove this assertion
$propertyNames = $graphNode->getPropertyNames();
$this->assertEquals(['key1', 'key2', 'key3'], $propertyNames);
}

public function testAnArrayCanBeInjectedViaTheConstructor()
Expand Down
Loading

0 comments on commit 421f8ce

Please sign in to comment.