|
@@ -15,9 +15,9 @@ discard block |
|
|
block discarded – undo |
|
15
|
15
|
|
|
16
|
16
|
class Dice |
|
17
|
17
|
{ |
|
18
|
|
- private $rules = []; // Rules which have been set using addRule() |
|
19
|
|
- private $cache = []; // A cache of closures based on class name so each class is only reflected once |
|
20
|
|
- private $instances = []; // Stores any instances marked as 'shared' so create() can return the same instance |
|
|
18
|
+ private $rules = []; // Rules which have been set using addRule() |
|
|
19
|
+ private $cache = []; // A cache of closures based on class name so each class is only reflected once |
|
|
20
|
+ private $instances = []; // Stores any instances marked as 'shared' so create() can return the same instance |
|
21
|
21
|
|
|
22
|
22
|
/** |
|
23
|
23
|
* Constructor which allows setting a default ruleset to apply to all objects. |
|
@@ -97,7 +97,7 @@ discard block |
|
|
block discarded – undo |
|
97
|
97
|
|
|
98
|
98
|
//If there are shared instances, create them and merge them with shared instances higher up the object graph |
|
99
|
99
|
if (isset($rule['shareInstances'])) { |
|
100
|
|
- $closure = function(array $args, array $share) use ($closure, $rule) { |
|
|
100
|
+ $closure = function (array $args, array $share) use ($closure, $rule) { |
|
101
|
101
|
return $closure($args, array_merge($args, $share, array_map([$this, 'create'], $rule['shareInstances']))); |
|
102
|
102
|
}; |
|
103
|
103
|
} |
Please login to merge, or discard this patch.