original_string: public function add($entry, $priority = self::DEFAULT_PRIORITY)
      {
          if (isset($this->entryClass) && !($entry instanceof $this->entryClass)) {
              throw new InvalidObjectClassException($this->entryClass, get_class($entry));
          }
          $this->entries[] = ['data' => $entry, 'priority' => $priority];
          $this->sorted = false;
          return $this;
      }
code: public function add($entry, $priority = self::DEFAULT_PRIORITY)
      {
          if (isset($this->entryClass) && !($entry instanceof $this->entryClass)) {
              throw new InvalidObjectClassException($this->entryClass, get_class($entry));
          }
          $this->entries[] = ['data' => $entry, 'priority' => $priority];
          $this->sorted = false;
          return $this;
      }
code_tokens: public function add ( $ entry , $ priority = self :: DEFAULT_PRIORITY ) { if ( isset ( $ this -> entryClass ) && ! ( $ entry instanceof $ this -> entryClass ) ) { throw new InvalidObjectClassException ( $ this -> entryClass , get_class ( $ entry ) ) ; } $ this -> entries [ ] = [ 'data' => $ entry , 'priority' => $ priority ] ; $ this -> sorted = false ; return $ this ; }
docstring: Add an entry to the list.
  @param mixed $entry
  @param int $priority
  @return $this
  @throws InvalidObjectClassException
docstring_tokens: Add an entry to the list .