1<?php 2 3namespace Mpdf; 4 5trait Strict 6{ 7 8 /** 9 * @param string $name method name 10 * @param array $args arguments 11 */ 12 public function __call($name, $args) 13 { 14 $class = method_exists($this, $name) ? 'parent' : get_class($this); 15 throw new \Mpdf\MpdfException("Call to undefined method $class::$name()"); 16 } 17 18 /** 19 * @param string $name lowercase method name 20 * @param array $args arguments 21 */ 22 public static function __callStatic($name, $args) 23 { 24 $class = get_called_class(); 25 throw new \Mpdf\MpdfException("Call to undefined static function $class::$name()"); 26 } 27 28 /** 29 * @param string $name property name 30 */ 31 public function &__get($name) 32 { 33 $class = get_class($this); 34 throw new \Mpdf\MpdfException("Cannot read an undeclared property $class::\$$name"); 35 } 36 37 /** 38 * @param string $name property name 39 * @param mixed $value property value 40 */ 41 public function __set($name, $value) 42 { 43 $class = get_class($this); 44 throw new \Mpdf\MpdfException("Cannot write to an undeclared property $class::\$$name"); 45 } 46 47 /** 48 * @param string $name property name 49 * @throws \Kdyby\StrictObjects\\Mpdf\MpdfException 50 */ 51 public function __isset($name) 52 { 53 $class = get_class($this); 54 throw new \Mpdf\MpdfException("Cannot read an undeclared property $class::\$$name"); 55 } 56 57 /** 58 * @param string $name property name 59 * @throws \Kdyby\StrictObjects\\Mpdf\MpdfException 60 */ 61 public function __unset($name) 62 { 63 $class = get_class($this); 64 throw new \Mpdf\MpdfException("Cannot unset the property $class::\$$name."); 65 } 66 67} 68