Container.php
public function set($id,$item,$tagArg = null)
  {
    if (!is_callable($item)) $this->instances[$id] = $item;
    else
    {
      $this->callables[$id] = $item;
      unset($this->instances[$id]);
    }
    if (!$tagArg) return $this;
    
    $tag = is_array($tagArg) ? $tagArg : ['name' => $tagArg];
    
    $tag['service_id'] = $id;
    
    $name = $tag['name'];
    
    $this->tags[$name][] = $tag;
    
    return $this;
  }
public function set($id,$item,$tagArg = null)
  {
    if (!is_callable($item)) $this->instances[$id] = $item;
    else
    {
      $this->callables[$id] = $item;
      unset($this->instances[$id]);
    }
    if (!$tagArg) return $this;
    
    $tag = is_array($tagArg) ? $tagArg : ['name' => $tagArg];
    
    $tag['service_id'] = $id;
    
    $name = $tag['name'];
    
    $this->tags[$name][] = $tag;
    
    return $this;
  }
public function set ( $ id , $ item , $ tagArg = null ) { if ( ! is_callable ( $ item ) ) $ this -> instances [ $ id ] = $ item ; else { $ this -> callables [ $ id ] = $ item ; unset ( $ this -> instances [ $ id ] ) ; } if ( ! $ tagArg ) return $ this ; $ tag = is_array ( $ tagArg ) ? $ tagArg : [ 'name' => $ tagArg ] ; $ tag [ 'service_id' ] = $ id ; $ name = $ tag [ 'name' ] ; $ this -> tags [ $ name ] [ ] = $ tag ; return $ this ; }
Add a service with optional tagging
Add a service with optional tagging