- $oldCallback = $this->setCurrentRevisionCallback( function ( $titleToCheck, $parser = false ) use ( $title, $content, $user, &$oldCallback ) {
- if ( $titleToCheck->equals( $title ) ) {
- return new Revision( array(
- 'page' => $title->getArticleID(),
- 'user_text' => $user->getName(),
- 'user' => $user->getId(),
- 'parent_id' => $title->getLatestRevId(),
- 'title' => $title,
- 'content' => $content
- ) );
- } else {
- return call_user_func( $oldCallback, $titleToCheck, $parser );
+ $oldCallback = $this->setCurrentRevisionCallback(
+ function (
+ $titleToCheck, $parser = false ) use ( $title, $content, $user, &$oldCallback
+ ) {
+ if ( $titleToCheck->equals( $title ) ) {
+ return new Revision( array(
+ 'page' => $title->getArticleID(),
+ 'user_text' => $user->getName(),
+ 'user' => $user->getId(),
+ 'parent_id' => $title->getLatestRevId(),
+ 'title' => $title,
+ 'content' => $content
+ ) );
+ } else {
+ return call_user_func( $oldCallback, $titleToCheck, $parser );
+ }