Skip to content

Commit 8a66320

Browse files
committed
rename getElementPath() to getIdentifierPath()
1 parent 5deebb8 commit 8a66320

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

lib/WebDriver/Container.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ protected function webDriverElement($value)
213213
$identifier = $value[LegacyElement::LEGACY_ELEMENT_ID];
214214

215215
return new LegacyElement(
216-
$this->getElementPath($identifier),
216+
$this->getIdentifierPath($identifier),
217217
$identifier
218218
);
219219
}
@@ -222,7 +222,7 @@ protected function webDriverElement($value)
222222
$identifier = $value[Element::WEB_ELEMENT_ID];
223223

224224
return new Element(
225-
$this->getElementPath($identifier),
225+
$this->getIdentifierPath($identifier),
226226
$identifier
227227
);
228228
}
@@ -244,11 +244,11 @@ public function __call($name, $arguments)
244244
}
245245

246246
/**
247-
* Get wire protocol URL for an element
247+
* Get wire protocol URL for an identifier
248248
*
249-
* @param string $elementId
249+
* @param string $identifier
250250
*
251251
* @return string
252252
*/
253-
abstract protected function getElementPath($elementId);
253+
abstract protected function getIdentifierPath($identifier);
254254
}

lib/WebDriver/Element.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function shadow()
145145
$shadowRootReference = $value[Shadow::SHADOW_ROOT_ID];
146146

147147
return new Shadow(
148-
preg_replace('/element/' . preg_quote($this->id, '/') . '$/', '/', $this->url), // remove /element/:elementid
148+
preg_replace('/' . preg_quote('element/' . $this->id, '/') . '$/', '/', $this->url), // remove /element/:elementid
149149
$shadowRootReference
150150
);
151151
}
@@ -156,8 +156,8 @@ public function shadow()
156156
/**
157157
* {@inheritdoc}
158158
*/
159-
protected function getElementPath($elementId)
159+
protected function getIdentifierPath($identifier)
160160
{
161-
return preg_replace('/' . preg_quote($this->id, '/') . '$/', $elementId, $this->url);
161+
return preg_replace('/' . preg_quote($this->id) . '$/', $identifier, $this->url);
162162
}
163163
}

lib/WebDriver/Execute.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ protected function webDriverElement($value)
140140
$identifier = $value[LegacyElement::LEGACY_ELEMENT_ID];
141141

142142
return new LegacyElement(
143-
$this->getElementPath('/element/' . $identifier),
143+
$this->getIdentifierPath('/element/' . $identifier),
144144
$identifier
145145
);
146146
}
@@ -149,7 +149,7 @@ protected function webDriverElement($value)
149149
$identifier = $value[Element::WEB_ELEMENT_ID];
150150

151151
return new Element(
152-
$this->getElementPath('/element/' . $identifier),
152+
$this->getIdentifierPath('/element/' . $identifier),
153153
$identifier
154154
);
155155
}
@@ -158,7 +158,7 @@ protected function webDriverElement($value)
158158
$identifier = $value[Shadow::SHADOW_ROOT_ID];
159159

160160
return new Shadow(
161-
$this->getElementPath('/shadow/' . $identifier),
161+
$this->getIdentifierPath('/shadow/' . $identifier),
162162
$identifier
163163
);
164164
}
@@ -169,8 +169,8 @@ protected function webDriverElement($value)
169169
/**
170170
* {@inheritdoc}
171171
*/
172-
protected function getElementPath($identifier)
172+
protected function getIdentifierPath($identifier)
173173
{
174-
return preg_replace('~/execute$~', '', $this->url) . $identifier;
174+
return preg_replace('~/execute$~', '', $this->url) . $identifier; // remove /execute from path
175175
}
176176
}

lib/WebDriver/LegacyExecute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function sync(array $jsonScript)
7272
/**
7373
* {@inheritdoc}
7474
*/
75-
protected function getElementPath($identifier)
75+
protected function getIdentifierPath($identifier)
7676
{
7777
return $this->url . $identifier;
7878
}

lib/WebDriver/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ public function setLegacy($legacy)
523523
/**
524524
* {@inheritdoc}
525525
*/
526-
protected function getElementPath($elementId)
526+
protected function getIdentifierPath($identifier)
527527
{
528-
return sprintf('%s/element/%s', $this->url, $elementId);
528+
return sprintf('%s/element/%s', $this->url, $identifier);
529529
}
530530

531531
/**

lib/WebDriver/Shadow.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public function getID()
7474
/**
7575
* {@inheritdoc}
7676
*/
77-
protected function getElementPath($elementId)
77+
protected function getIdentifierPath($identifier)
7878
{
79-
return sprintf('%s/element/%s', $this->url, $elementId);
79+
return sprintf('%s/element/%s', $this->url, $identifier);
8080
}
8181
}

0 commit comments

Comments
 (0)