示例#1
0
 public function testCanSetAnGetValues()
 {
     $object = $this->object;
     $getset = Object::setAndGet($object, 'set', 'get');
     $get = Object::get($object, 'set');
     $this->assertEquals($getset, 'get');
     $this->assertEquals($get, $getset);
 }
示例#2
0
 /**
  * Resolve value by uses as attribute as raw.
  *
  * @param  \SimpleXMLElement  $content
  * @param  string  $use
  * @param  mixed  $default
  *
  * @return mixed
  */
 protected function getRawValueAttribute(SimpleXMLElement $content, $use, $default = null)
 {
     list($value, $attribute) = explode('::', $use, 2);
     $parent = $content;
     if (!empty($value) && is_null($parent = Object::get($content, $value))) {
         return $default;
     }
     $attributes = $parent->attributes();
     return Arrays::get($attributes, $attribute, $default);
 }