src/ObserverQueue.php
public function attach(ObserverInterface $observer): void
    {
        $key = spl_object_hash($observer);

        if ( array_key_exists($key, $this->observers) ) {
            throw new ObservatoryException(
                'Provided observer already known, hash: '.$key
            );
        }

        $this->observers[$key] = $observer;
    }
public function attach(ObserverInterface $observer): void
    {
        $key = spl_object_hash($observer);

        if ( array_key_exists($key, $this->observers) ) {
            throw new ObservatoryException(
                'Provided observer already known, hash: '.$key
            );
        }

        $this->observers[$key] = $observer;
    }
public function attach ( ObserverInterface $ observer ) : void { $ key = spl_object_hash ( $ observer ) ; if ( array_key_exists ( $ key , $ this -> observers ) ) { throw new ObservatoryException ( 'Provided observer already known, hash: ' . $ key ) ; } $ this -> observers [ $ key ] = $ observer ; }
attaches an observer to the observable.

@param ObserverInterface $observer
@throws ObservatoryException when the provided observer is already known
@return void
attaches an observer to the observable .