‪TYPO3CMS  ‪main
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 
67 {
80  public function ‪__isset(string $propertyName)
81  {
82  if (isset($this->deprecatedPublicProperties[$propertyName])) {
83  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
84  return isset($this->$propertyName);
85  }
86  return false;
87  }
88 
99  public function ‪__get(string $propertyName)
100  {
101  if (isset($this->deprecatedPublicProperties[$propertyName])) {
102  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
103  }
104  return property_exists($this, $propertyName) ? $this->$propertyName : null;
105  }
106 
119  public function ‪__set(string $propertyName, $propertyValue)
120  {
121  // It's allowed to set an unknown property as public, the check is thus necessary
122  if (property_exists($this, $propertyName) && isset($this->deprecatedPublicProperties[$propertyName])) {
123  trigger_error($this->deprecatedPublicProperties[$propertyName], E_USER_DEPRECATED);
124  }
125  $this->$propertyName = $propertyValue;
126  }
127 
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:80
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__set
‪__set(string $propertyName, $propertyValue)
Definition: PublicPropertyDeprecationTrait.php:119
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__get
‪mixed __get(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:99
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait\__unset
‪__unset(string $propertyName)
Definition: PublicPropertyDeprecationTrait.php:133
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait
Definition: PublicPropertyDeprecationTrait.php:67
‪TYPO3\CMS\Core\Compatibility
Definition: PublicMethodDeprecationTrait.php:18