Skip to content
Snippets Groups Projects

1.x

Merged Bartek Jaskulski requested to merge 1.x into review
1 file
+ 6
2
Compare changes
  • Side-by-side
  • Inline
@@ -29,11 +29,15 @@ class ArrayBindingLoader implements BindingDefinitions {
@@ -29,11 +29,15 @@ class ArrayBindingLoader implements BindingDefinitions {
foreach ( $bindings as $key => $value ) {
foreach ( $bindings as $key => $value ) {
if ( is_array( $value ) ) {
if ( is_array( $value ) ) {
foreach ( $value as $unit ) {
foreach ( $value as $unit ) {
yield $this->factory->create( $unit, is_int( $key ) ? null : $key );
yield $this->create( $unit, $key );
}
}
} else {
} else {
yield $this->factory->create( $value, is_int( $key ) ? null : $key );
yield $this->create( $value, $key );
}
}
}
}
}
}
 
 
private function create( $value, $hook ) {
 
return $this->factory->create( $value, is_int( $hook ) ? null : $hook );
 
}
}
}
Loading