public function attach(ServerObserver $observer)
    {
        if ($this->state) {
            throw new \Error("Cannot attach observers after the server has started");
        }

        $this->observers->attach($observer);
    }
public function attach(ServerObserver $observer)
    {
        if ($this->state) {
            throw new \Error("Cannot attach observers after the server has started");
        }

        $this->observers->attach($observer);
    }
public function attach ( ServerObserver $ observer ) { if ( $ this -> state ) { throw new \ Error ( "Cannot attach observers after the server has started" ) ; } $ this -> observers -> attach ( $ observer ) ; }
Attach an observer.

@param ServerObserver $observer

@throws \Error If the server has started.
Attach an observer .