public function reset() { $this->processedGenerationSkills->clear(); $this->processedImportanceSkills->clear(); $this->queuedImportanceSkills->clear(); $this->modifiedSkills->clear(); $this->ancestors->clear(); $this->descendents->clear(); }
/** * Clears all methods * * @return $this */ public function clearMethods() { foreach ($this->methods as $method) { $method->setParent(null); } $this->methods->clear(); return $this; }
/** * Clears all properties * * @return $this */ public function clearProperties() { foreach ($this->properties as $property) { $property->setParent(null); } $this->properties->clear(); return $this; }
public function testAddGetRemove() { $key1 = 'key1'; $key2 = 'key2'; $key3 = 'key3'; $item1 = 'item 1'; $item2 = 'item 2'; $item3 = 'item 3'; $items = [$key1 => $item1, $key2 => $item2]; $keys = new Set([$key1, $key2]); $values = new ArrayList([$item1, $item2]); $map = new Map(); $map->set($key1, $item1); $this->assertEquals(1, $map->size()); $this->assertEquals($item1, $map->get($key1)); $this->assertEquals($key1, $map->getKey($item1)); $this->assertNull($map->getKey($item2)); $this->assertTrue($map->has($key1)); $this->assertFalse($map->has($key2)); $map->remove($key1); $this->assertEquals(0, $map->size()); $map->setAll($items); $this->assertEquals(2, $map->size()); $this->assertEquals($keys, $map->keys()); $this->assertEquals($values, $map->values()); $map->set($key3, $item3); $this->assertEquals(3, $map->size()); $map->clear(); $this->assertEquals(0, $map->size()); $dupKeyItems = [$key1 => $item1, $key2 => $item2]; $map->setAll($dupKeyItems); $map->set($key2, $item3); $this->assertEquals(2, $map->size()); $this->assertEquals($item3, $map->get($key2)); $this->assertEmpty($map->get('non_existing_key')); $this->assertEmpty($map->remove('non_existing_key')); $this->assertEquals([], $map->get('non_existing_key', [])); }
/** * Clears all constants * * @return $this */ public function clearConstants() { $this->constants->clear(); return $this; }