‪TYPO3CMS  10.4
PublicPropertyDeprecationTrait.php
Go to the documentation of this file.
1 <?php
2 
3 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 
19 
68 {
81  public function ‪__isset(string $propertyName)
82  {
83  if (isset($this->deprecatedPublicProperties[$propertyName])) {
84  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
85  return isset($this->$propertyName);
86  }
87  return false;
88  }
89 
100  public function ‪__get(string $propertyName)
101  {
102  if (isset($this->deprecatedPublicProperties[$propertyName])) {
103  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
104  }
105  return $this->$propertyName;
106  }
107 
120  public function ‪__set(string $propertyName, $propertyValue)
121  {
122  // It's allowed to set an unknown property as public, the check is thus necessary
123  if (property_exists($this, $propertyName) && isset($this->deprecatedPublicProperties[$propertyName])) {
124  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
125  }
126  $this->$propertyName = $propertyValue;
127  }
128 
135  public function ‪__unset(string $propertyName)
136  {
137  if (isset($this->deprecatedPublicProperties[$propertyName])) {
138  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
139  }
140  unset($this->$propertyName);
141  }
142 }
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__isset
‪bool __isset(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:81
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__set
‪__set(string $propertyName, $propertyValue)
Definition: PublicPropertyDeprecationTrait.php:120
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__get
‪mixed __get(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:100
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__unset
‪__unset(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:135
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait
Definition: PublicPropertyDeprecationTrait.php:68
‪TYPO3\CMS\Core\Compatibility
Definition: PseudoSiteTcaDisplayCondition.php:18