public function will(Behaviour $behaviour = null) {
        if ($behaviour) {
            $this->behaviour = $behaviour;
            return $behaviour;
        }
        return new BehaviourFactory(function (Behaviour $behaviour) {
            $this->setStubbed(true);
            $this->behaviour = $behaviour;
        });
    }
public function will(Behaviour $behaviour = null) {
        if ($behaviour) {
            $this->behaviour = $behaviour;
            return $behaviour;
        }
        return new BehaviourFactory(function (Behaviour $behaviour) {
            $this->setStubbed(true);
            $this->behaviour = $behaviour;
        });
    }
public function will ( Behaviour $ behaviour = null ) { if ( $ behaviour ) { $ this -> behaviour = $ behaviour ; return $ behaviour ; } return new BehaviourFactory ( function ( Behaviour $ behaviour ) { $ this -> setStubbed ( true ) ; $ this -> behaviour = $ behaviour ; } ) ; }
Sets the given Behaviour or returns a BehaviourFactory if non given

@param behaviour\Behaviour $behaviour
@return BehaviourFactory|Behaviour
Sets the given Behaviour or returns a BehaviourFactory if non given