wiki.techinc.nl/tests/phpunit/includes/debug/TestDeprecatedClass.php
Umherirrender a1de8b8700 Tests: Mark more more closures as static
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208

Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
2021-02-09 02:55:57 +00:00

48 lines
1.2 KiB
PHP

<?php
class TestDeprecatedClass {
use DeprecationHelper;
protected $protectedDeprecated = 1;
protected $protectedNonDeprecated = 1;
private $privateDeprecated = 1;
private $privateNonDeprecated = 1;
private $fallbackDeprecated = 1;
public function __construct() {
$this->deprecatePublicProperty( 'protectedDeprecated', '1.23' );
$this->deprecatePublicProperty( 'privateDeprecated', '1.24' );
$this->deprecatePublicPropertyFallback( 'fallbackDeprecated', '1.25',
function () {
return $this->fallbackDeprecated;
},
function ( $value ) {
$this->fallbackDeprecated = $value;
}
);
$this->deprecatePublicPropertyFallback( 'fallbackGetterOnly', '1.25',
static function () {
return 1;
}
);
}
public function setThings( $prod, $prond, $prid, $prind ) {
$this->protectedDeprecated = $prod;
$this->protectedNonDeprecated = $prond;
$this->privateDeprecated = $prid;
$this->privateNonDeprecated = $prind;
}
public function getThings() {
return [
'prod' => $this->protectedDeprecated,
'prond' => $this->protectedNonDeprecated,
'prid' => $this->privateDeprecated,
'prind' => $this->privateNonDeprecated,
];
}
}