src/ClassGeneration/MethodCollection.php
public function add($method)
    {
        if (!$method instanceof MethodInterface) {
            throw new \InvalidArgumentException('This Method must be a instance of \ClassGeneration\MethodInterface');
        }
        if ($method->getName() === null) {
            $method->setName('method' . ($this->count() + 1));
        }

        parent::set($method->getName(), $method);
        return true;
    }
public function add($method)
    {
        if (!$method instanceof MethodInterface) {
            throw new \InvalidArgumentException('This Method must be a instance of \ClassGeneration\MethodInterface');
        }
        if ($method->getName() === null) {
            $method->setName('method' . ($this->count() + 1));
        }

        parent::set($method->getName(), $method);
        return true;
    }
public function add ( $ method ) { if ( ! $ method instanceof MethodInterface ) { throw new \ InvalidArgumentException ( 'This Method must be a instance of \ClassGeneration\MethodInterface' ) ; } if ( $ method -> getName ( ) === null ) { $ method -> setName ( 'method' . ( $ this -> count ( ) + 1 ) ) ; } parent :: set ( $ method -> getName ( ) , $ method ) ; return true ; }
Adds a new Method on collection.

@param MethodInterface $method

@return bool

@throws \InvalidArgumentException
Adds a new Method on collection .