Skip to content

Commit

Permalink
Merge pull request #820 from stof/fix_phpdoc
Browse files Browse the repository at this point in the history
Fix some wrong types in phpdoc
  • Loading branch information
stof authored Jan 19, 2022
2 parents 4ce8a28 + 852ce78 commit 45da58c
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 61 deletions.
60 changes: 31 additions & 29 deletions src/Driver/DriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function setBasicAuth($user, $password);
/**
* Switches to specific browser window.
*
* @param string $name window name (null for switching back to main window)
* @param string|null $name window name (null for switching back to main window)
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand All @@ -163,7 +163,7 @@ public function switchToWindow($name = null);
/**
* Switches to specific iFrame.
*
* @param string $name iframe name (null for switching back)
* @param string|null $name iframe name (null for switching back)
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand All @@ -184,7 +184,7 @@ public function setRequestHeader($name, $value);
/**
* Returns last response headers.
*
* @return array
* @return array<string, string|string[]>
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand All @@ -194,8 +194,10 @@ public function getResponseHeaders();
/**
* Sets cookie.
*
* @param string $name
* @param string $value
* Passing null as value will delete the cookie.
*
* @param string $name
* @param string|null $value
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand Down Expand Up @@ -248,7 +250,7 @@ public function getScreenshot();
/**
* Return the names of all open windows.
*
* @return array array of all open windows
* @return string[] array of all open windows
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand Down Expand Up @@ -278,7 +280,7 @@ public function getWindowName();
public function find($xpath);

/**
* Returns element's tag name by it's XPath query.
* Returns element's tag name by its XPath query.
*
* @param string $xpath
*
Expand All @@ -290,7 +292,7 @@ public function find($xpath);
public function getTagName($xpath);

/**
* Returns element's text by it's XPath query.
* Returns element's text by its XPath query.
*
* @param string $xpath
*
Expand All @@ -302,7 +304,7 @@ public function getTagName($xpath);
public function getText($xpath);

/**
* Returns element's inner html by it's XPath query.
* Returns element's inner html by its XPath query.
*
* @param string $xpath
*
Expand All @@ -314,7 +316,7 @@ public function getText($xpath);
public function getHtml($xpath);

/**
* Returns element's outer html by it's XPath query.
* Returns element's outer html by its XPath query.
*
* @param string $xpath
*
Expand All @@ -326,7 +328,7 @@ public function getHtml($xpath);
public function getOuterHtml($xpath);

/**
* Returns element's attribute by it's XPath query.
* Returns element's attribute by its XPath query.
*
* @param string $xpath
* @param string $name
Expand All @@ -339,7 +341,7 @@ public function getOuterHtml($xpath);
public function getAttribute($xpath, $name);

/**
* Returns element's value by it's XPath query.
* Returns element's value by its XPath query.
*
* @param string $xpath
*
Expand All @@ -353,7 +355,7 @@ public function getAttribute($xpath, $name);
public function getValue($xpath);

/**
* Sets element's value by it's XPath query.
* Sets element's value by its XPath query.
*
* @param string $xpath
* @param string|bool|array $value
Expand All @@ -366,7 +368,7 @@ public function getValue($xpath);
public function setValue($xpath, $value);

/**
* Checks checkbox by it's XPath query.
* Checks checkbox by its XPath query.
*
* @param string $xpath
*
Expand All @@ -378,7 +380,7 @@ public function setValue($xpath, $value);
public function check($xpath);

/**
* Unchecks checkbox by it's XPath query.
* Unchecks checkbox by its XPath query.
*
* @param string $xpath
*
Expand All @@ -390,7 +392,7 @@ public function check($xpath);
public function uncheck($xpath);

/**
* Checks whether checkbox or radio button located by it's XPath query is checked.
* Checks whether checkbox or radio button located by its XPath query is checked.
*
* @param string $xpath
*
Expand All @@ -404,7 +406,7 @@ public function uncheck($xpath);
public function isChecked($xpath);

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

/**
* Checks whether select option, located by it's XPath query, is selected.
* Checks whether select option, located by its XPath query, is selected.
*
* @param string $xpath
*
Expand All @@ -432,7 +434,7 @@ public function selectOption($xpath, $value, $multiple = false);
public function isSelected($xpath);

/**
* Clicks button or link located by it's XPath query.
* Clicks button or link located by its XPath query.
*
* @param string $xpath
*
Expand All @@ -442,7 +444,7 @@ public function isSelected($xpath);
public function click($xpath);

/**
* Double-clicks button or link located by it's XPath query.
* Double-clicks button or link located by its XPath query.
*
* @param string $xpath
*
Expand All @@ -452,7 +454,7 @@ public function click($xpath);
public function doubleClick($xpath);

/**
* Right-clicks button or link located by it's XPath query.
* Right-clicks button or link located by its XPath query.
*
* @param string $xpath
*
Expand All @@ -462,7 +464,7 @@ public function doubleClick($xpath);
public function rightClick($xpath);

/**
* Attaches file path to file field located by it's XPath query.
* Attaches file path to file field located by its XPath query.
*
* @param string $xpath
* @param string $path
Expand All @@ -475,7 +477,7 @@ public function rightClick($xpath);
public function attachFile($xpath, $path);

/**
* Checks whether element visible located by it's XPath query.
* Checks whether element visible located by its XPath query.
*
* @param string $xpath
*
Expand Down Expand Up @@ -531,9 +533,9 @@ public function keyPress($xpath, $char, $modifier = null);
/**
* Pressed down specific keyboard key.
*
* @param string $xpath
* @param string|int $char could be either char ('b') or char-code (98)
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
* @param string $xpath
* @param string|int $char could be either char ('b') or char-code (98)
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand All @@ -543,9 +545,9 @@ public function keyDown($xpath, $char, $modifier = null);
/**
* Pressed up specific keyboard key.
*
* @param string $xpath
* @param string|int $char could be either char ('b') or char-code (98)
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
* @param string $xpath
* @param string|int $char could be either char ('b') or char-code (98)
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
*
* @throws UnsupportedDriverActionException When operation not supported by the driver
* @throws DriverException When the operation cannot be done
Expand Down
14 changes: 7 additions & 7 deletions src/Element/NodeElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function setValue($value)
}

/**
* Checks whether element has attribute with specified name.
* Checks whether element has an attribute with specified name.
*
* @param string $name
*
Expand Down Expand Up @@ -308,8 +308,8 @@ public function blur()
/**
* Presses specific keyboard key.
*
* @param string|int $char could be either char ('b') or char-code (98)
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
* @param string|int $char could be either char ('b') or char-code (98)
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
*/
public function keyPress($char, $modifier = null)
{
Expand All @@ -319,8 +319,8 @@ public function keyPress($char, $modifier = null)
/**
* Pressed down specific keyboard key.
*
* @param string|int $char could be either char ('b') or char-code (98)
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
* @param string|int $char could be either char ('b') or char-code (98)
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
*/
public function keyDown($char, $modifier = null)
{
Expand All @@ -330,8 +330,8 @@ public function keyDown($char, $modifier = null)
/**
* Pressed up specific keyboard key.
*
* @param string|int $char could be either char ('b') or char-code (98)
* @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
* @param string|int $char could be either char ('b') or char-code (98)
* @param string|null $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
*/
public function keyUp($char, $modifier = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ElementHtmlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ElementHtmlException extends ExpectationException
* @param string $message optional message
* @param DriverInterface|Session $driver driver instance
* @param Element $element element
* @param \Exception $exception expectation exception
* @param \Exception|null $exception expectation exception
*/
public function __construct($message, $driver, Element $element, \Exception $exception = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Exception/ElementNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class ElementNotFoundException extends ExpectationException
* Initializes exception.
*
* @param DriverInterface|Session $driver driver instance
* @param string $type element type
* @param string $selector element selector type
* @param string $locator element locator
* @param string|null $type element type
* @param string|null $selector element selector type
* @param string|null $locator element locator
*/
public function __construct($driver, $type = null, $selector = null, $locator = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/UnsupportedDriverActionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UnsupportedDriverActionException extends DriverException
*
* @param string $template what is unsupported?
* @param DriverInterface $driver driver instance
* @param \Exception $previous previous exception
* @param \Exception|null $previous previous exception
*/
public function __construct($template, DriverInterface $driver, \Exception $previous = null)
{
Expand Down
13 changes: 8 additions & 5 deletions src/Mink.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
namespace Behat\Mink;

/**
* Mink sessions manager.
* Mink session manager.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Mink
{
/**
* @var null|string
*/
private $defaultSessionName;

/**
Expand Down Expand Up @@ -102,7 +105,7 @@ public function getDefaultSessionName()
/**
* Returns registered session by it's name or default one.
*
* @param string $name session name
* @param string|null $name session name
*
* @return Session
*
Expand All @@ -116,7 +119,7 @@ public function getSession($name = null)
/**
* Checks whether a named session (or the default session) has already been started.
*
* @param string $name session name - if null then the default session will be checked
* @param string|null $name session name - if null then the default session will be checked
*
* @return bool whether the session has been started
*
Expand All @@ -132,7 +135,7 @@ public function isSessionStarted($name = null)
/**
* Returns session asserter.
*
* @param Session|string $session session object or name
* @param Session|string|null $session session object or name
*
* @return WebAssert
*/
Expand Down Expand Up @@ -184,7 +187,7 @@ public function stopSessions()
/**
* Returns the named or default session without starting it.
*
* @param string $name session name
* @param string|null $name session name
*
* @return Session
*
Expand Down
1 change: 0 additions & 1 deletion src/Selector/Xpath/Manipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,4 @@ private function splitUnionParts($xpath)

return array($xpath); // The XPath expression is invalid
}

}
Loading

0 comments on commit 45da58c

Please sign in to comment.