public function testPropertiesExist() { $o = new \stdClass(); $o->hello = null; $o->world = null; $o->{'!'} = null; $this->assertTrue(Object::propertiesExist($o, 'hello', 'world', '!')); $this->assertTrue(Object::propertiesExist($o, 'hello', '!')); $this->assertFalse(Object::propertiesExist($o, 'hello', 'test')); }
/** * Creates a new list with $value repeated $count number of times * @param mixed $value * @param int $count * @return \static */ public static function repeat($value, $count) { $list = new static(); for ($i = 0; $i < $count; ++$i) { $list->_Arr[$i] = Functions\Object::copy($value); } return $list; }