Debian Codegraph @

tests/phpunit/includes/media/FakeDimensionFile.php

raw symbols SCIP
1 <?php
2
3 use MediaWiki\Title\Title;
4
5 class FakeDimensionFile extends File {
6 /** @var bool */
7 public $mustRender = false;
8 /** @var string */
9 public $mime;
10 /** @var int[] */
11 public $dimensions;
12
13 public function __construct( $dimensions, $mime = 'unknown/unknown' ) {
14 parent::__construct( Title::makeTitle( NS_FILE, 'Test' ),
15 new NullRepo( null ) );
16
17 $this->dimensions = $dimensions;
18 $this->mime = $mime;
19 }
20
21 public function getWidth( $page = 1 ) {
22 return $this->dimensions[0];
23 }
24
25 public function getHeight( $page = 1 ) {
26 return $this->dimensions[1];
27 }
28
29 public function mustRender() {
30 return $this->mustRender;
31 }
32
33 public function getPath() {
34 return '';
35 }
36
37 public function getMimeType() {
38 return $this->mime;
39 }
40 }