Skip to content

Commit 45da58c

Browse files
authored
Merge pull request #820 from stof/fix_phpdoc
Fix some wrong types in phpdoc
2 parents 4ce8a28 + 852ce78 commit 45da58c

8 files changed

Lines changed: 67 additions & 61 deletions

File tree

src/Driver/DriverInterface.php

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function setBasicAuth($user, $password);
153153
/**
154154
* Switches to specific browser window.
155155
*
156-
* @param string $name window name (null for switching back to main window)
156+
* @param string|null $name window name (null for switching back to main window)
157157
*
158158
* @throws UnsupportedDriverActionException When operation not supported by the driver
159159
* @throws DriverException When the operation cannot be done
@@ -163,7 +163,7 @@ public function switchToWindow($name = null);
163163
/**
164164
* Switches to specific iFrame.
165165
*
166-
* @param string $name iframe name (null for switching back)
166+
* @param string|null $name iframe name (null for switching back)
167167
*
168168
* @throws UnsupportedDriverActionException When operation not supported by the driver
169169
* @throws DriverException When the operation cannot be done
@@ -184,7 +184,7 @@ public function setRequestHeader($name, $value);
184184
/**
185185
* Returns last response headers.
186186
*
187-
* @return array
187+
* @return array<string, string|string[]>
188188
*
189189
* @throws UnsupportedDriverActionException When operation not supported by the driver
190190
* @throws DriverException When the operation cannot be done
@@ -194,8 +194,10 @@ public function getResponseHeaders();
194194
/**
195195
* Sets cookie.
196196
*
197-
* @param string $name
198-
* @param string $value
197+
* Passing null as value will delete the cookie.
198+
*
199+
* @param string $name
200+
* @param string|null $value
199201
*
200202
* @throws UnsupportedDriverActionException When operation not supported by the driver
201203
* @throws DriverException When the operation cannot be done
@@ -248,7 +250,7 @@ public function getScreenshot();
248250
/**
249251
* Return the names of all open windows.
250252
*
251-
* @return array array of all open windows
253+
* @return string[] array of all open windows
252254
*
253255
* @throws UnsupportedDriverActionException When operation not supported by the driver
254256
* @throws DriverException When the operation cannot be done
@@ -278,7 +280,7 @@ public function getWindowName();
278280
public function find($xpath);
279281

280282
/**
281-
* Returns element's tag name by it's XPath query.
283+
* Returns element's tag name by its XPath query.
282284
*
283285
* @param string $xpath
284286
*
@@ -290,7 +292,7 @@ public function find($xpath);
290292
public function getTagName($xpath);
291293

292294
/**
293-
* Returns element's text by it's XPath query.
295+
* Returns element's text by its XPath query.
294296
*
295297
* @param string $xpath
296298
*
@@ -302,7 +304,7 @@ public function getTagName($xpath);
302304
public function getText($xpath);
303305

304306
/**
305-
* Returns element's inner html by it's XPath query.
307+
* Returns element's inner html by its XPath query.
306308
*
307309
* @param string $xpath
308310
*
@@ -314,7 +316,7 @@ public function getText($xpath);
314316
public function getHtml($xpath);
315317

316318
/**
317-
* Returns element's outer html by it's XPath query.
319+
* Returns element's outer html by its XPath query.
318320
*
319321
* @param string $xpath
320322
*
@@ -326,7 +328,7 @@ public function getHtml($xpath);
326328
public function getOuterHtml($xpath);
327329

328330
/**
329-
* Returns element's attribute by it's XPath query.
331+
* Returns element's attribute by its XPath query.
330332
*
331333
* @param string $xpath
332334
* @param string $name
@@ -339,7 +341,7 @@ public function getOuterHtml($xpath);
339341
public function getAttribute($xpath, $name);
340342

341343
/**
342-
* Returns element's value by it's XPath query.
344+
* Returns element's value by its XPath query.
343345
*
344346
* @param string $xpath
345347
*
@@ -353,7 +355,7 @@ public function getAttribute($xpath, $name);
353355
public function getValue($xpath);
354356

355357
/**
356-
* Sets element's value by it's XPath query.
358+
* Sets element's value by its XPath query.
357359
*
358360
* @param string $xpath
359361
* @param string|bool|array $value
@@ -366,7 +368,7 @@ public function getValue($xpath);
366368
public function setValue($xpath, $value);
367369

368370
/**
369-
* Checks checkbox by it's XPath query.
371+
* Checks checkbox by its XPath query.
370372
*
371373
* @param string $xpath
372374
*
@@ -378,7 +380,7 @@ public function setValue($xpath, $value);
378380
public function check($xpath);
379381

380382
/**
381-
* Unchecks checkbox by it's XPath query.
383+
* Unchecks checkbox by its XPath query.
382384
*
383385
* @param string $xpath
384386
*
@@ -390,7 +392,7 @@ public function check($xpath);
390392
public function uncheck($xpath);
391393

392394
/**
393-
* Checks whether checkbox or radio button located by it's XPath query is checked.
395+
* Checks whether checkbox or radio button located by its XPath query is checked.
394396
*
395397
* @param string $xpath
396398
*
@@ -404,7 +406,7 @@ public function uncheck($xpath);
404406
public function isChecked($xpath);
405407

406408
/**
407-
* Selects option from select field or value in radio group located by it's XPath query.
409+
* Selects option from select field or value in radio group located by its XPath query.
408410
*
409411
* @param string $xpath
410412
* @param string $value
@@ -418,7 +420,7 @@ public function isChecked($xpath);
418420
public function selectOption($xpath, $value, $multiple = false);
419421

420422
/**
421-
* Checks whether select option, located by it's XPath query, is selected.
423+
* Checks whether select option, located by its XPath query, is selected.
422424
*
423425
* @param string $xpath
424426
*
@@ -432,7 +434,7 @@ public function selectOption($xpath, $value, $multiple = false);
432434
public function isSelected($xpath);
433435

434436
/**
435-
* Clicks button or link located by it's XPath query.
437+
* Clicks button or link located by its XPath query.
436438
*
437439
* @param string $xpath
438440
*
@@ -442,7 +444,7 @@ public function isSelected($xpath);
442444
public function click($xpath);
443445

444446
/**
445-
* Double-clicks button or link located by it's XPath query.
447+
* Double-clicks button or link located by its XPath query.
446448
*
447449
* @param string $xpath
448450
*
@@ -452,7 +454,7 @@ public function click($xpath);
452454
public function doubleClick($xpath);
453455

454456
/**
455-
* Right-clicks button or link located by it's XPath query.
457+
* Right-clicks button or link located by its XPath query.
456458
*
457459
* @param string $xpath
458460
*
@@ -462,7 +464,7 @@ public function doubleClick($xpath);
462464
public function rightClick($xpath);
463465

464466
/**
465-
* Attaches file path to file field located by it's XPath query.
467+
* Attaches file path to file field located by its XPath query.
466468
*
467469
* @param string $xpath
468470
* @param string $path
@@ -475,7 +477,7 @@ public function rightClick($xpath);
475477
public function attachFile($xpath, $path);
476478

477479
/**
478-
* Checks whether element visible located by it's XPath query.
480+
* Checks whether element visible located by its XPath query.
479481
*
480482
* @param string $xpath
481483
*
@@ -531,9 +533,9 @@ public function keyPress($xpath, $char, $modifier = null);
531533
/**
532534
* Pressed down specific keyboard key.
533535
*
534-
* @param string $xpath
535-
* @param string|int $char could be either char ('b') or char-code (98)
536-
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
536+
* @param string $xpath
537+
* @param string|int $char could be either char ('b') or char-code (98)
538+
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
537539
*
538540
* @throws UnsupportedDriverActionException When operation not supported by the driver
539541
* @throws DriverException When the operation cannot be done
@@ -543,9 +545,9 @@ public function keyDown($xpath, $char, $modifier = null);
543545
/**
544546
* Pressed up specific keyboard key.
545547
*
546-
* @param string $xpath
547-
* @param string|int $char could be either char ('b') or char-code (98)
548-
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
548+
* @param string $xpath
549+
* @param string|int $char could be either char ('b') or char-code (98)
550+
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
549551
*
550552
* @throws UnsupportedDriverActionException When operation not supported by the driver
551553
* @throws DriverException When the operation cannot be done

src/Element/NodeElement.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function setValue($value)
106106
}
107107

108108
/**
109-
* Checks whether element has attribute with specified name.
109+
* Checks whether element has an attribute with specified name.
110110
*
111111
* @param string $name
112112
*
@@ -308,8 +308,8 @@ public function blur()
308308
/**
309309
* Presses specific keyboard key.
310310
*
311-
* @param string|int $char could be either char ('b') or char-code (98)
312-
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
311+
* @param string|int $char could be either char ('b') or char-code (98)
312+
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
313313
*/
314314
public function keyPress($char, $modifier = null)
315315
{
@@ -319,8 +319,8 @@ public function keyPress($char, $modifier = null)
319319
/**
320320
* Pressed down specific keyboard key.
321321
*
322-
* @param string|int $char could be either char ('b') or char-code (98)
323-
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
322+
* @param string|int $char could be either char ('b') or char-code (98)
323+
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
324324
*/
325325
public function keyDown($char, $modifier = null)
326326
{
@@ -330,8 +330,8 @@ public function keyDown($char, $modifier = null)
330330
/**
331331
* Pressed up specific keyboard key.
332332
*
333-
* @param string|int $char could be either char ('b') or char-code (98)
334-
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
333+
* @param string|int $char could be either char ('b') or char-code (98)
334+
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
335335
*/
336336
public function keyUp($char, $modifier = null)
337337
{

src/Exception/ElementHtmlException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ElementHtmlException extends ExpectationException
3434
* @param string $message optional message
3535
* @param DriverInterface|Session $driver driver instance
3636
* @param Element $element element
37-
* @param \Exception $exception expectation exception
37+
* @param \Exception|null $exception expectation exception
3838
*/
3939
public function __construct($message, $driver, Element $element, \Exception $exception = null)
4040
{

src/Exception/ElementNotFoundException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class ElementNotFoundException extends ExpectationException
2424
* Initializes exception.
2525
*
2626
* @param DriverInterface|Session $driver driver instance
27-
* @param string $type element type
28-
* @param string $selector element selector type
29-
* @param string $locator element locator
27+
* @param string|null $type element type
28+
* @param string|null $selector element selector type
29+
* @param string|null $locator element locator
3030
*/
3131
public function __construct($driver, $type = null, $selector = null, $locator = null)
3232
{

src/Exception/UnsupportedDriverActionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class UnsupportedDriverActionException extends DriverException
2424
*
2525
* @param string $template what is unsupported?
2626
* @param DriverInterface $driver driver instance
27-
* @param \Exception $previous previous exception
27+
* @param \Exception|null $previous previous exception
2828
*/
2929
public function __construct($template, DriverInterface $driver, \Exception $previous = null)
3030
{

src/Mink.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
namespace Behat\Mink;
1212

1313
/**
14-
* Mink sessions manager.
14+
* Mink session manager.
1515
*
1616
* @author Konstantin Kudryashov <ever.zet@gmail.com>
1717
*/
1818
class Mink
1919
{
20+
/**
21+
* @var null|string
22+
*/
2023
private $defaultSessionName;
2124

2225
/**
@@ -102,7 +105,7 @@ public function getDefaultSessionName()
102105
/**
103106
* Returns registered session by it's name or default one.
104107
*
105-
* @param string $name session name
108+
* @param string|null $name session name
106109
*
107110
* @return Session
108111
*
@@ -116,7 +119,7 @@ public function getSession($name = null)
116119
/**
117120
* Checks whether a named session (or the default session) has already been started.
118121
*
119-
* @param string $name session name - if null then the default session will be checked
122+
* @param string|null $name session name - if null then the default session will be checked
120123
*
121124
* @return bool whether the session has been started
122125
*
@@ -132,7 +135,7 @@ public function isSessionStarted($name = null)
132135
/**
133136
* Returns session asserter.
134137
*
135-
* @param Session|string $session session object or name
138+
* @param Session|string|null $session session object or name
136139
*
137140
* @return WebAssert
138141
*/
@@ -184,7 +187,7 @@ public function stopSessions()
184187
/**
185188
* Returns the named or default session without starting it.
186189
*
187-
* @param string $name session name
190+
* @param string|null $name session name
188191
*
189192
* @return Session
190193
*

src/Selector/Xpath/Manipulator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,4 @@ private function splitUnionParts($xpath)
125125

126126
return array($xpath); // The XPath expression is invalid
127127
}
128-
129128
}

0 commit comments

Comments
 (0)