| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | class B extends A |
||
| 23 | { |
||
| 24 | public function __construct() |
||
| 25 | { |
||
| 26 | parent::__construct(); |
||
| 27 | unset( |
||
| 28 | $this->property2, |
||
| 29 | $this->property4 |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | // This is a wrapper for attribute2 |
||
| 34 | public $property2; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Sets attribute of parent class directly |
||
| 38 | */ |
||
| 39 | public function setProperty2($value) |
||
| 40 | { |
||
| 41 | $this->attribute2 = $value; //This is accesible since is protected |
||
| 42 | } |
||
| 43 | |||
| 44 | public $property4; |
||
| 45 | protected function getProperty4() |
||
| 46 | { |
||
| 47 | return $this->attribute4; |
||
| 48 | } |
||
| 49 | |||
| 50 | // ERRORS ######################################### |
||
| 51 | /** |
||
| 52 | * Try to make read-only property accesible in this parent class |
||
| 53 | * @throws BadMethodCallException |
||
| 54 | */ |
||
| 55 | protected function setProperty1($value) |
||
| 58 | } |
||
| 59 | } |
||
| 60 |