44. 3. Law of Demeter (without) <?php class PC { public function powerOn () { $this ->mobo->cpu->cache -> powerOn (); } }
45. 3. Law of Demeter (with) <?php class PC { public function powerOn () { foreach ( $this ->powered as $item ) { /** @var Powered $item */ $item -> powerOn (); } } }
46. 3. Law of Demeter (with) <?php class PC { public function powerOn () { $this ->mobo-> powerOn (); } }