![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/phpgt/dom/src/ |
<?php namespace Gt\Dom; /** * Calls prop_* methods to provide live properties through the * __get and __set magic methods. * * If the class with this trait has its own __get method, for compatibility * it should call the __get_live method after its own processing. * * @property-read Document $ownerDocument */ trait LiveProperty { public function __get($name) { return self::__get_live($name); } public function __set($name, $value) { return self::__set_live($name, $value); } private function __get_live($name) { if(defined("self::BOOLEAN_ATTRIBUTES")) { if(in_array($name, self::BOOLEAN_ATTRIBUTES)) { return $this->getBooleanAttribute($name); } } $methodName = "prop_get_$name"; if(method_exists($this, $methodName)) { return $this->$methodName(); } if(isset(PropertyAttribute::PROPERTY_ATTRIBUTE_MAP[$name])) { $attribute = PropertyAttribute::PROPERTY_ATTRIBUTE_MAP[$name]; if($attribute === true) { return $this->hasAttribute($name); } return $this->getAttribute($name); } } private function __set_live($name, $value) { if(defined("self::BOOLEAN_ATTRIBUTES")) { if(in_array($name, self::BOOLEAN_ATTRIBUTES)) { return $this->setBooleanAttribute($name, $value); } } $methodName = "prop_set_$name"; if(method_exists($this, $methodName)) { return $this->$methodName($value); } if(isset(PropertyAttribute::PROPERTY_ATTRIBUTE_MAP[$name])) { $attribute = PropertyAttribute::PROPERTY_ATTRIBUTE_MAP[$name]; if($attribute === true) { $newAttr = $this->ownerDocument->createAttribute($name); if($value) { $this->setAttributeNode($newAttr); } else { $this->removeAttribute($name); } } else { $this->setAttribute($attribute, $value); } } return null; } }