public function observe(
        $id,
        ObserverInterface $observer,
        $priority = SubjectInterface::FIRST_PRIORITY
    ) {
        $this->getSubject($id)->registerObserver($observer, $priority);
    }
public function observe(
        $id,
        ObserverInterface $observer,
        $priority = SubjectInterface::FIRST_PRIORITY
    ) {
        $this->getSubject($id)->registerObserver($observer, $priority);
    }
public function observe ( $ id , ObserverInterface $ observer , $ priority = SubjectInterface :: FIRST_PRIORITY ) { $ this -> getSubject ( $ id ) -> registerObserver ( $ observer , $ priority ) ; }
Registers an event observer with a subject.

This method is a shortcut to the builder subject's `registerObserver()`
method. Instead of doing the following example:

use Phine\Observer\SubjectInterface;
use Phine\Phar\Builder;

$builder
->getSubject(Builder::ADD_STRING)
->registerObserver(
new Observer(),
SubjectInterface::FIRST_PRIORITY
);

You may instead do the following example:

use Phine\Observer\SubjectInterface;
use Phine\Phar\Builder;

$builder->observe(
Builder::ADD_STRING,
new Observer(),
SubjectInterface::FIRST_PRIORITY
);

@see SubjectInterface::registerObserver

@param string            $id                  The event subject identifier.
@param ObserverInterface $observer            The event subject observer.
@param integer           $priority (optional) The priority of the observer.

@api
Registers an event observer with a subject .