Skip to content

Commit b231b51

Browse files
committed
Unset should work even if the property isn’t set.
See #8
1 parent 7b45e61 commit b231b51

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Ruler/Variable.php

+3-9
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ public function offsetGet($name)
139139
*
140140
* @see setValue
141141
*
142-
* @param string $name Property name
143-
* @param mixed $value The default Variable value
142+
* @param string $name Property name
143+
* @param mixed $value The default Variable value
144144
*/
145145
public function offsetSet($name, $value)
146146
{
@@ -150,16 +150,10 @@ public function offsetSet($name, $value)
150150
/**
151151
* Fluent interface method for removing a VariableProperty reference.
152152
*
153-
* @throws InvalidArgumentException If a VariableProperty of that name is not defined.
154-
*
155-
* @param string $name Property name
153+
* @param string $name Property name
156154
*/
157155
public function offsetUnset($name)
158156
{
159-
if (!$this->offsetExists($name)) {
160-
throw new \InvalidArgumentException('Unknown variable property: ' . $name);
161-
}
162-
163157
unset($this->properties[$name]);
164158
}
165159

0 commit comments

Comments
 (0)