- if ( isset( $stuff['deps'] ) ) {
- foreach ( $stuff['deps'] as $dep ) {
- $this->mOutput->addTemplate( $dep['title'], $dep['page_id'], $dep['rev_id'] );
- if ( $dep['title']->equals( $this->getTitle() ) ) {
- // Self-transclusion; final result may change based on the new page version
- $this->setOutputFlag( 'vary-revision', 'Self transclusion' );
- }
+ foreach ( ( $stuff['deps'] ?? [] ) as $dep ) {
+ $this->mOutput->addTemplate( $dep['title'], $dep['page_id'], $dep['rev_id'] );
+ if ( $dep['title']->equals( $this->getTitle() ) && $rev instanceof Revision ) {
+ // Self-transclusion; final result may change based on the new page version
+ $this->setOutputFlag( 'vary-revision-sha1', 'Self transclusion' );
+ $this->getOutput()->setRevisionUsedSha1Base36( $rev->getSha1() );