Skip to content

Commit

Permalink
Merge pull request #16 from hjr3/resource-link
Browse files Browse the repository at this point in the history
Resource class is not unit testable
  • Loading branch information
hjr3 committed Oct 28, 2014
2 parents f01c211 + 20bde16 commit 241713f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion library/Hal/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Resource extends AbstractHal
* @var bool
*/
protected $jsonNumericCheck = self::JSON_NUMERIC_CHECK_OFF;

/**
*
* @param string $href
Expand All @@ -70,11 +71,19 @@ class Resource extends AbstractHal
public function __construct($href, array $data = array(), $title = null, $name = null, $hreflang = null)
{
$this->setLink(
new Link($href, 'self', $title, $name, $hreflang)
$this->createLink($href, 'self', $title, $name, $hreflang)
);
$this->setData($data);
}

/**
* @return Link
*/
protected function createLink($href, $rel, $title, $name, $hreflang)
{
return new Link($href, $rel, $title, $name, $hreflang);
}

/**
* @return Link
*/
Expand Down

0 comments on commit 241713f

Please sign in to comment.