@@ -72,7 +72,7 @@ |
||
72 | 72 | if (!is_callable($callback)) { |
73 | 73 | throw new \BadMethodCallException(sprintf( |
74 | 74 | 'Proxy error: Method "%s" does not exist in proxied "%s"', |
75 | - $method, |
|
75 | + $method, |
|
76 | 76 | get_class($entity) |
77 | 77 | )); |
78 | 78 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | : SnapshotMeta::class; |
38 | 38 | |
39 | 39 | $this->snapshotMeta = new $snapshotMetaClass(); |
40 | - $this->snapshotEntity = $source; |
|
40 | + $this->snapshotEntity = $source; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getOriginalEntity() |
@@ -72,7 +72,7 @@ |
||
72 | 72 | * @throws \Core\Entity\Exception\OutOfBoundsException if the property does not exists. |
73 | 73 | * @since 0.25 |
74 | 74 | */ |
75 | - public function notEmpty($property, array $args=[]); |
|
75 | + public function notEmpty($property, array $args = []); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Checks, if this entity has a property. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return $this->$method($value); |
50 | 50 | } |
51 | 51 | |
52 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this). "'"); |
|
52 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (method_exists($this, $method)) { |
77 | 77 | return $this->$method(); |
78 | 78 | } |
79 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this) . "'"); |
|
79 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -21,8 +21,8 @@ |
||
21 | 21 | */ |
22 | 22 | class SnapshotMeta implements |
23 | 23 | ModificationDateAwareEntityInterface, |
24 | - DraftableEntityInterface, |
|
25 | - Status\StatusAwareEntityInterface |
|
24 | + DraftableEntityInterface, |
|
25 | + Status\StatusAwareEntityInterface |
|
26 | 26 | { |
27 | 27 | use ModificationDateAwareEntityTrait, DraftableEntityTrait, Status\StatusAwareEntityTrait; |
28 | 28 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $className = get_class($entity); |
55 | 55 | |
56 | - if (! isset($key)) { |
|
56 | + if (!isset($key)) { |
|
57 | 57 | $key = $className; |
58 | 58 | } |
59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $entityId = $entity->getId(); |
64 | 64 | |
65 | 65 | // check if entity is not persisted |
66 | - if (! $entityId) { |
|
66 | + if (!$entityId) { |
|
67 | 67 | // persist entity & retrieve its ID |
68 | 68 | $this->repositories->getRepository($className)->store($entity); |
69 | 69 | $entityId = $entity->getId(); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getAttachedEntity($key) |
83 | 83 | { |
84 | - if (! isset($this->references[$key])) { |
|
84 | + if (!isset($this->references[$key])) { |
|
85 | 85 | return; |
86 | 86 | } |
87 | 87 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $entity = $this->repositories->getRepository($reference['repository']) |
90 | 90 | ->find($reference['id']); |
91 | 91 | |
92 | - if (! $entity) { |
|
92 | + if (!$entity) { |
|
93 | 93 | // remove reference if entity does not exists |
94 | 94 | unset($this->references[$key]); |
95 | 95 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | use EntityTrait, ClonePropertiesTrait; |
30 | 30 | |
31 | - private $cloneProperties = [ '!items' ]; |
|
31 | + private $cloneProperties = ['!items']; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * The leafs. |
@@ -153,7 +153,7 @@ |
||
153 | 153 | |
154 | 154 | public function getValueWithParents($withRoot = false, $useNames = false) |
155 | 155 | { |
156 | - $parts = [ ($useNames ? $this->getName() : $this->getValue()) ]; |
|
156 | + $parts = [($useNames ? $this->getName() : $this->getValue())]; |
|
157 | 157 | $item = $this; |
158 | 158 | |
159 | 159 | while ($item = $item->getParent()) { |
@@ -20,16 +20,16 @@ |
||
20 | 20 | */ |
21 | 21 | trait EntityTrait |
22 | 22 | { |
23 | - public function notEmpty($property, array $args=[]) |
|
23 | + public function notEmpty($property, array $args = []) |
|
24 | 24 | { |
25 | 25 | $method = "get$property"; |
26 | 26 | |
27 | 27 | if (!method_exists($this, $method)) { |
28 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this) . "'"); |
|
28 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $value = count($args) |
32 | - ? call_user_func_array([ $this, $method ], $args) |
|
32 | + ? call_user_func_array([$this, $method], $args) |
|
33 | 33 | : $this->$method(); |
34 | 34 | |
35 | 35 | if (null === $value) { // is_scalar does not consider 'null' to be scalar value. |
@@ -78,7 +78,7 @@ |
||
78 | 78 | /** |
79 | 79 | * @see AttachableEntityInterface::createAttachedEntity() |
80 | 80 | */ |
81 | - public function createAttachedEntity($entityClass, $values = [], $key=null) |
|
81 | + public function createAttachedEntity($entityClass, $values = [], $key = null) |
|
82 | 82 | { |
83 | 83 | return $this->getAttachableEntityManager()->createAttachedEntity($entityClass, $values, $key); |
84 | 84 | } |