Skip to content

Commit

Permalink
Revert "Merge pull request #138 from clue-labs/remove-attribute"
Browse files Browse the repository at this point in the history
This reverts commit 9159d94, reversing
changes made to 0336a4d.
  • Loading branch information
clue committed Sep 29, 2019
1 parent 1eafe38 commit 35b0014
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 86 deletions.
7 changes: 0 additions & 7 deletions src/Attribute/AttributeAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ public function getAttribute($name, $default = null);
*/
public function setAttribute($name, $value);

/**
* Removes a single attribute with the given $name
*
* @param string $name
*/
public function removeAttribute($name);

/**
* get a container for all attributes
*
Expand Down
1 change: 0 additions & 1 deletion src/Attribute/AttributeBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ interface AttributeBag extends AttributeAware
{
// public function getAttribute($name, $default);
// public function setAttribute($name, $value);
// public function removeAttribute();
// public function getAttributeBag();

/**
Expand Down
10 changes: 0 additions & 10 deletions src/Attribute/AttributeBagContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ public function setAttribute($name, $value)
return $this;
}

/**
* Removes a single attribute with the given $name
*
* @param string $name
*/
public function removeAttribute($name)
{
unset($this->attributes[$name]);
}

/**
* get an array of all attributes
*
Expand Down
10 changes: 0 additions & 10 deletions src/Attribute/AttributeBagNamespaced.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ public function setAttribute($name, $value)
$this->bag->setAttribute($this->prefix . $name, $value);
}

/**
* Removes a single attribute with the given $name
*
* @param string $name
*/
public function removeAttribute($name)
{
$this->bag->removeAttribute($this->prefix . $name);
}

/**
* get an array of all attributes
*
Expand Down
10 changes: 0 additions & 10 deletions src/Attribute/AttributeBagReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ public function setAttribute($name, $value)
return $this;
}

/**
* Removes a single attribute with the given $name
*
* @param string $name
*/
public function removeAttribute($name)
{
unset($this->attributes[$name]);
}

/**
* get an array of all attributes
*
Expand Down
5 changes: 0 additions & 5 deletions src/Edge/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ public function setAttribute($name, $value)
$this->attributes[$name] = $value;
}

public function removeAttribute($name)
{
unset($this->attributes[$name]);
}

public function getAttributeBag()
{
return new AttributeBagReference($this->attributes);
Expand Down
5 changes: 0 additions & 5 deletions src/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,6 @@ public function setAttribute($name, $value)
$this->attributes[$name] = $value;
}

public function removeAttribute($name)
{
unset($this->attributes[$name]);
}

public function getAttributeBag()
{
return new AttributeBagReference($this->attributes);
Expand Down
5 changes: 0 additions & 5 deletions src/Vertex.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,6 @@ public function setAttribute($name, $value)
$this->attributes[$name] = $value;
}

public function removeAttribute($name)
{
unset($this->attributes[$name]);
}

public function getAttributeBag()
{
return new AttributeBagReference($this->attributes);
Expand Down
13 changes: 0 additions & 13 deletions tests/Attribute/AbstractAttributeAwareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ public function testAttributeSetGetDefault(AttributeAware $entity)
$this->assertEquals('default', $entity->getAttribute('unknown', 'default'));
}

/**
* @depends testAttributeAwareInterface
* @param AttributeAware $entity
*/
public function testAttributeSetRemoveGet(AttributeAware $entity)
{
$entity->setAttribute('test', 'value');
$this->assertEquals('value', $entity->getAttribute('test'));

$entity->removeAttribute('test');
$this->assertEquals(null, $entity->getAttribute('test'));
}

/**
* @depends testAttributeAwareInterface
* @param AttributeAware $entity
Expand Down
7 changes: 1 addition & 6 deletions tests/Attribute/AttributeBagContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

use Fhaculty\Graph\Attribute\AttributeBagContainer;

class AttributeBagContainerTest extends AbstractAttributeAwareTest
class AttributeBagContainerTest extends TestCase
{
protected function createAttributeAware()
{
return new AttributeBagContainer();
}

public function testEmpty()
{
$bag = new AttributeBagContainer();
Expand Down
7 changes: 1 addition & 6 deletions tests/Attribute/AttributeBagNamespacedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
use Fhaculty\Graph\Attribute\AttributeAware;
use Fhaculty\Graph\Attribute\AttributeBagContainer;

class AtributeBagNamespacedTest extends AbstractAttributeAwareTest
class AtributeBagNamespacedTest extends TestCase
{
protected function createAttributeAware()
{
return new AttributeBagNamespaced(new AttributeBagContainer(), 'test.');
}

public function testBagContainer()
{
$container = new AttributeBagContainer();
Expand Down
9 changes: 1 addition & 8 deletions tests/Attribute/AttributeBagReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@

use Fhaculty\Graph\Attribute\AttributeBagReference;

class AttributeBagReferenceTest extends AbstractAttributeAwareTest
class AttributeBagReferenceTest extends TestCase
{
protected function createAttributeAware()
{
$attributes = array();

return new AttributeBagReference($attributes);
}

public function testEmpty()
{
$attributes = array();
Expand Down

0 comments on commit 35b0014

Please sign in to comment.