src/Base.php
public function addMethod($source, $destination = null)
    {
        //argument test
         Argument::i()
            //argument 1 must be a string
            ->test(1, 'string')
            //argument 2 must be callable or null
            ->test(2, 'callable', 'null');

        if (is_null($destination)) {
            //when someone calls a class call this instead
            Route::i()->set($source, $this);
            return $this;
        }
        
        //if it's an array they meant to bind the callback
        if (!is_array($destination)) {
            //so there's no scope
            $destination = $destination->bindTo($this, get_class($this));
        }
        
        //store it
        self::$invokables[$source] = $destination;
        
        return $this;
    }
public function addMethod($source, $destination = null)
    {
        //argument test
         Argument::i()
            //argument 1 must be a string
            ->test(1, 'string')
            //argument 2 must be callable or null
            ->test(2, 'callable', 'null');

        if (is_null($destination)) {
            //when someone calls a class call this instead
            Route::i()->set($source, $this);
            return $this;
        }
        
        //if it's an array they meant to bind the callback
        if (!is_array($destination)) {
            //so there's no scope
            $destination = $destination->bindTo($this, get_class($this));
        }
        
        //store it
        self::$invokables[$source] = $destination;
        
        return $this;
    }
public function addMethod ( $ source , $ destination = null ) { //argument test Argument :: i ( ) //argument 1 must be a string -> test ( 1 , 'string' ) //argument 2 must be callable or null -> test ( 2 , 'callable' , 'null' ) ; if ( is_null ( $ destination ) ) { //when someone calls a class call this instead Route :: i ( ) -> set ( $ source , $ this ) ; return $ this ; } //if it's an array they meant to bind the callback if ( ! is_array ( $ destination ) ) { //so there's no scope $ destination = $ destination -> bindTo ( $ this , get_class ( $ this ) ) ; } //store it self :: $ invokables [ $ source ] = $ destination ; return $ this ; }
Creates a class route for this class.

@param *string       $source     the class route name
@param callable|null $desination callback handler

@return Eden\Core\Base
Creates a class route for this class .