Skip to content

Commit 81eef65

Browse files
authored
Merge pull request #187 from clue-labs/entity
Add new Entity class to simplify holding attributes and remove attribute namespace
2 parents c690f6d + 555a585 commit 81eef65

19 files changed

+141
-695
lines changed

src/Attribute/AttributeAware.php

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

src/Attribute/AttributeBag.php

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

src/Attribute/AttributeBagNamespaced.php

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

src/Attribute/AttributeBagReference.php

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

src/Edge.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Graphp\Graph;
44

5-
use Graphp\Graph\Attribute\AttributeAware;
6-
use Graphp\Graph\Attribute\AttributeBagReference;
75
use Graphp\Graph\Exception\BadMethodCallException;
86
use Graphp\Graph\Exception\InvalidArgumentException;
97
use Graphp\Graph\Exception\LogicException;
@@ -16,7 +14,7 @@
1614
* @see EdgeUndirected
1715
* @see EdgeDirected
1816
*/
19-
abstract class Edge implements VerticesAggregate, AttributeAware
17+
abstract class Edge extends Entity implements VerticesAggregate
2018
{
2119
protected $attributes = array();
2220

@@ -134,28 +132,4 @@ private function __clone()
134132
throw new BadMethodCallException();
135133
// @codeCoverageIgnoreEnd
136134
}
137-
138-
public function getAttribute($name, $default = null)
139-
{
140-
return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
141-
}
142-
143-
public function setAttribute($name, $value)
144-
{
145-
$this->attributes[$name] = $value;
146-
147-
return $this;
148-
}
149-
150-
public function removeAttribute($name)
151-
{
152-
unset($this->attributes[$name]);
153-
154-
return $this;
155-
}
156-
157-
public function getAttributeBag()
158-
{
159-
return new AttributeBagReference($this->attributes);
160-
}
161135
}

0 commit comments

Comments
 (0)