本文整理汇总了PHP中Map::merge方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::merge方法的具体用法?PHP Map::merge怎么用?PHP Map::merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: append
/**
* Appends the layers of another WMC to this WMC.
*
* @return void
* @param $xml2 Object
*/
public function append($xml2)
{
$someWmc = new wmc();
$someWmc->createFromXml($xml2);
$this->mainMap->append($someWmc->mainMap);
if (isset($this->overviewMap) && isset($someWmc->overviewMap)) {
// There is only one WMS in the overview map; merge, not append
$this->overviewMap->merge($someWmc->overviewMap);
}
}
示例2: testMerge
public function testMerge()
{
$this->properties->merge(['foo5' => 'bar5']);
$this->assertEquals('bar5', $this->properties->get('foo5'));
}
示例3: removeDuplicates
private function removeDuplicates(Map $images, Map $figures) : Map
{
$urls = $figures->reduce(new Set(UrlInterface::class), function (Set $urls, UrlInterface $url) : Set {
return $urls->add($url);
});
$urls = $images->reduce($urls, function (Set $urls, UrlInterface $url) : Set {
return $urls->add($url);
});
$urls = (new RemoveDuplicatedUrls())($urls);
return $figures->merge($images)->filter(function (UrlInterface $url) use($urls) : bool {
return $urls->contains($url);
});
}