original_string: public function reprioritise($entry, $newPriority, $oldPriority = false)
      {
          $changedAnything = false;
          foreach ($this->entries as $i => &$entryData) {
              if ($entry === $entryData['data'] && ($oldPriority === false || $entryData['priority'] == $oldPriority)) {
                  $entryData['priority'] = $newPriority;
                  $changedAnything = true;
              }
          }
          if ($changedAnything) {
              $this->sorted = false;
          }
          return $this;
      }
code: public function reprioritise($entry, $newPriority, $oldPriority = false)
      {
          $changedAnything = false;
          foreach ($this->entries as $i => &$entryData) {
              if ($entry === $entryData['data'] && ($oldPriority === false || $entryData['priority'] == $oldPriority)) {
                  $entryData['priority'] = $newPriority;
                  $changedAnything = true;
              }
          }
          if ($changedAnything) {
              $this->sorted = false;
          }
          return $this;
      }
code_tokens: public function reprioritise ( $ entry , $ newPriority , $ oldPriority = false ) { $ changedAnything = false ; foreach ( $ this -> entries as $ i => & $ entryData ) { if ( $ entry === $ entryData [ 'data' ] && ( $ oldPriority === false || $ entryData [ 'priority' ] == $ oldPriority ) ) { $ entryData [ 'priority' ] = $ newPriority ; $ changedAnything = true ; } } if ( $ changedAnything ) { $ this -> sorted = false ; } return $ this ; }
docstring: change the priority for an entry.
  @param mixed $entry
  @param int $newPriority
  @param bool|int $oldPriority If falsechange remove all instances of $entry from the list, otherwise only those with matching priority
  @return $this
docstring_tokens: change the priority for an entry .