Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9fe3ba

Browse filesBrowse files
committed
Make some CS changes
1 parent 4c74dea commit b9fe3ba
Copy full SHA for b9fe3ba

File tree

1 file changed

+6
-6
lines changed
Filter options

1 file changed

+6
-6
lines changed

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Crawler implements \Countable, \IteratorAggregate
3434
private $namespaces = [];
3535

3636
/**
37-
* @var \ArrayIterator A map of cached namespaces
37+
* @var \ArrayObject A map of cached namespaces
3838
*/
3939
private $cachedNamespaces;
4040

@@ -73,7 +73,7 @@ public function __construct($node = null, string $uri = null, string $baseHref =
7373
$this->uri = $uri;
7474
$this->baseHref = $baseHref ?: $uri;
7575
$this->html5Parser = class_exists(HTML5::class) ? new HTML5(['disable_html_ns' => true]) : null;
76-
$this->cachedNamespaces = new \ArrayIterator();
76+
$this->cachedNamespaces = new \ArrayObject();
7777

7878
$this->add($node);
7979
}
@@ -105,7 +105,7 @@ public function clear()
105105
{
106106
$this->nodes = [];
107107
$this->document = null;
108-
$this->cachedNamespaces = new \ArrayIterator();
108+
$this->cachedNamespaces = new \ArrayObject();
109109
}
110110

111111
/**
@@ -1198,15 +1198,15 @@ private function discoverNamespace(\DOMXPath $domxpath, string $prefix): ?string
11981198
return $this->namespaces[$prefix];
11991199
}
12001200

1201-
if ($this->cachedNamespaces->offsetExists($prefix)) {
1202-
return $this->cachedNamespaces->offsetGet($prefix);
1201+
if (isset($this->cachedNamespaces[$prefix])) {
1202+
return $this->cachedNamespaces[$prefix];
12031203
}
12041204

12051205
// ask for one namespace, otherwise we'd get a collection with an item for each node
12061206
$namespaces = $domxpath->query(sprintf('(//namespace::*[name()="%s"])[last()]', $this->defaultNamespacePrefix === $prefix ? '' : $prefix));
12071207

12081208
$namespace = ($node = $namespaces->item(0)) ? $node->nodeValue : null;
1209-
$this->cachedNamespaces->offsetSet($prefix, $namespace);
1209+
$this->cachedNamespaces[$prefix] = $namespace;
12101210

12111211
return $namespace;
12121212
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.