original_string: public function observe($class)
      {
          $className = is_string($class) ? $class : get_class($class);
  
          if (!class_exists($className)) {
              return;
          }
  
          foreach ($this->getObservableAbilities() as $ability) {
              if (method_exists($class, $ability)) {
                  $this->registerAbility($ability, $className . '@' . $ability);
              }
          }
      }
code: public function observe($class)
      {
          $className = is_string($class) ? $class : get_class($class);
  
          if (!class_exists($className)) {
              return;
          }
  
          foreach ($this->getObservableAbilities() as $ability) {
              if (method_exists($class, $ability)) {
                  $this->registerAbility($ability, $className . '@' . $ability);
              }
          }
      }
code_tokens: public function observe ( $ class ) { $ className = is_string ( $ class ) ? $ class : get_class ( $ class ) ; if ( ! class_exists ( $ className ) ) { return ; } foreach ( $ this -> getObservableAbilities ( ) as $ ability ) { if ( method_exists ( $ class , $ ability ) ) { $ this -> registerAbility ( $ ability , $ className . '@' . $ ability ) ; } } }
docstring: Register an observer with the Component.
  
  @param $class
docstring_tokens: Register an observer with the Component .