src/BuilderBag.php
public function add(BuilderInterface $builder)
    {
        if (method_exists($builder, 'getName')) {
            $name = $builder->getName();
        } else {
            $name = bin2hex(random_bytes(30));
        }

        $this->bag[$name] = $builder;

        return $name;
    }
public function add(BuilderInterface $builder)
    {
        if (method_exists($builder, 'getName')) {
            $name = $builder->getName();
        } else {
            $name = bin2hex(random_bytes(30));
        }

        $this->bag[$name] = $builder;

        return $name;
    }
public function add ( BuilderInterface $ builder ) { if ( method_exists ( $ builder , 'getName' ) ) { $ name = $ builder -> getName ( ) ; } else { $ name = bin2hex ( random_bytes ( 30 ) ) ; } $ this -> bag [ $ name ] = $ builder ; return $ name ; }
Adds a builder.

@param BuilderInterface $builder

@return string
Adds a builder .