Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Mar 26, 2014
1 parent 518fa79 commit 558028f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
17 changes: 0 additions & 17 deletions src/Hateoas/Hateoas.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,6 @@ public function getSerializer()
return $this->serializer;
}

/**
* @deprecated You should use the `getLinkHelper()` method to get the helper instead of
* relying on this proxy method. This method will be removed as of 2.2.0.
*
* Gets the 'href' value of an object's link, identified by its rel name.
*
* @param object $object
* @param string $rel
* @param boolean $absolute
*
* @return string|null
*/
public function getLinkHref($object, $rel, $absolute = false)
{
return $this->getLinkHelper()->getLinkHref($object, $rel, $absolute);
}

/**
* @return LinkHelper
*/
Expand Down
13 changes: 0 additions & 13 deletions src/Hateoas/Representation/Factory/PagerfantaFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ public function __construct($pageParameterName = null, $limitParameterName = nul
$this->limitParameterName = $limitParameterName;
}

/**
* @deprecated This method will be removed as of 2.2. Use the
* `createRepresentation()` method instead.
*/
public function create(Pagerfanta $pager, $route, array $routeParameters = array(), $inline = null, $absolute = false)
{
return $this->createRepresentation(
$pager,
new Route($route, $routeParameters, $absolute),
$inline
);
}

/**
* @param Pagerfanta $pager The pager
* @param Route $route The collection's route
Expand Down
10 changes: 5 additions & 5 deletions tests/Hateoas/Tests/HateoasTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ protected function setUp()

public function testGetLinkHrefUrlWithUnknownRelShouldReturnNull()
{
$this->assertNull($this->hateoas->getLinkHref(new Will(123), 'unknown-rel'));
$this->assertNull($this->hateoas->getLinkHref(new Will(123), 'unknown-rel', true));
$this->assertNull($this->hateoas->getLinkHelper()->getLinkHref(new Will(123), 'unknown-rel'));
$this->assertNull($this->hateoas->getLinkHelper()->getLinkHref(new Will(123), 'unknown-rel', true));
}

public function testGetLinkHrefUrl()
{
$this->assertEquals('/users/123', $this->hateoas->getLinkHref(new Will(123), 'self'));
$this->assertEquals('/users/123', $this->hateoas->getLinkHref(new Will(123), 'self', false));
$this->assertEquals('/users/123', $this->hateoas->getLinkHelper()->getLinkHref(new Will(123), 'self'));
$this->assertEquals('/users/123', $this->hateoas->getLinkHelper()->getLinkHref(new Will(123), 'self', false));
}

public function testGetLinkHrefUrlWithAbsoluteTrue()
{
$this->assertEquals('http://example.com/users/123', $this->hateoas->getLinkHref(new Will(123), 'self', true));
$this->assertEquals('http://example.com/users/123', $this->hateoas->getLinkHelper()->getLinkHref(new Will(123), 'self', true));
}
}

0 comments on commit 558028f

Please sign in to comment.