‪TYPO3CMS  9.5
PublicPropertyDeprecationTrait.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
66 {
79  public function ‪__isset(string $propertyName)
80  {
81  if (isset($this->deprecatedPublicProperties[$propertyName])) {
82  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
83  return isset($this->$propertyName);
84  }
85  return false;
86  }
87 
98  public function ‪__get(string $propertyName)
99  {
100  if (isset($this->deprecatedPublicProperties[$propertyName])) {
101  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
102  }
103  return $this->$propertyName;
104  }
105 
118  public function ‪__set(string $propertyName, $propertyValue)
119  {
120  // It's allowed to set an unknown property as public, the check is thus necessary
121  if (property_exists($this, $propertyName) && isset($this->deprecatedPublicProperties[$propertyName])) {
122  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
123  }
124  $this->$propertyName = $propertyValue;
125  }
126 
133  public function ‪__unset(string $propertyName)
134  {
135  if (isset($this->deprecatedPublicProperties[$propertyName])) {
136  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
137  }
138  unset($this->$propertyName);
139  }
140 }
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__isset
‪bool __isset(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:79
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__set
‪__set(string $propertyName, $propertyValue)
Definition: PublicPropertyDeprecationTrait.php:118
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__get
‪mixed __get(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:98
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__unset
‪__unset(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:133
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait
Definition: PublicPropertyDeprecationTrait.php:66
‪TYPO3\CMS\Core\Compatibility
Definition: LoadedExtensionArrayElement.php:2