src/Zicht/Tool/Container/Container.php
public function decl($id, $callable)
    {
        if (!is_callable($callable)) {
            throw new \InvalidArgumentException("Passed declaration is not callable");
        }
        $this->set($id, function (Container $c) use($callable, $id) {
            Debug::enterScope(join('.', (array)$id));
            if (null !== ($value = call_user_func($callable, $c))) {
                $c->set($id, $value);
            }
            Debug::exitScope(join('.', (array)$id));
            return $value;
        });
    }
public function decl($id, $callable)
    {
        if (!is_callable($callable)) {
            throw new \InvalidArgumentException("Passed declaration is not callable");
        }
        $this->set($id, function (Container $c) use($callable, $id) {
            Debug::enterScope(join('.', (array)$id));
            if (null !== ($value = call_user_func($callable, $c))) {
                $c->set($id, $value);
            }
            Debug::exitScope(join('.', (array)$id));
            return $value;
        });
    }
public function decl ( $ id , $ callable ) { if ( ! is_callable ( $ callable ) ) { throw new \ InvalidArgumentException ( "Passed declaration is not callable" ) ; } $ this -> set ( $ id , function ( Container $ c ) use ( $ callable , $ id ) { Debug :: enterScope ( join ( '.' , ( array ) $ id ) ) ; if ( null !== ( $ value = call_user_func ( $ callable , $ c ) ) ) { $ c -> set ( $ id , $ value ) ; } Debug :: exitScope ( join ( '.' , ( array ) $ id ) ) ; return $ value ; } ) ; }
Does a declaration, i.e., the first time the declaration is called, it's resulting value overwrites the
declaration.

@param array|string $id
@param callable $callable
@return void

@throws \InvalidArgumentException
Does a declaration i . e . the first time the declaration is called it s resulting value overwrites the declaration .