Skip to content

Commit b9b8be4

Browse files
committed
Add soft @return type declarations to interfaces and base classes
1 parent a9653d7 commit b9b8be4

File tree

7 files changed

+53
-0
lines changed

7 files changed

+53
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog for FriendsOfBehat/MinkExtension
2+
3+
## Version 2.8.0
4+
5+
* Added soft `@return` type hints to the `MinkAwareContext` and `DriverFactory` interfaces and to all methods in `MinkContext` and `RawMinkContext`.
6+
If you implement or extend these classes or any of the drivers shipped here, make sure to add _real_ corresponding return types to your
7+
implementations now. Signatures will be changed to include return types in the next major version.

src/Behat/MinkExtension/Context/MinkAwareContext.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ interface MinkAwareContext extends Context
2424
* Sets Mink instance.
2525
*
2626
* @param Mink $mink Mink session manager
27+
*
28+
* @return void
2729
*/
2830
public function setMink(Mink $mink);
2931

3032
/**
3133
* Sets parameters provided for Mink.
3234
*
3335
* @param array $parameters
36+
*
37+
* @return void
3438
*/
3539
public function setMinkParameters(array $parameters);
3640
}

src/Behat/MinkExtension/Context/MinkContext.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class MinkContext extends RawMinkContext implements TranslatableContext
2929
*
3030
* @Given /^(?:|I )am on (?:|the )homepage$/
3131
* @When /^(?:|I )go to (?:|the )homepage$/
32+
*
33+
* @return void
3234
*/
3335
public function iAmOnHomepage()
3436
{
@@ -43,6 +45,8 @@ public function iAmOnHomepage()
4345
*
4446
* @Given /^(?:|I )am on "(?P<page>[^"]+)"$/
4547
* @When /^(?:|I )go to "(?P<page>[^"]+)"$/
48+
*
49+
* @return void
4650
*/
4751
public function visit($page)
4852
{
@@ -55,6 +59,8 @@ public function visit($page)
5559
* Example: And I reload the page
5660
*
5761
* @When /^(?:|I )reload the page$/
62+
*
63+
* @return void
5864
*/
5965
public function reload()
6066
{
@@ -66,6 +72,8 @@ public function reload()
6672
* Example: When I move backward one page
6773
*
6874
* @When /^(?:|I )move backward one page$/
75+
*
76+
* @return void
6977
*/
7078
public function back()
7179
{
@@ -77,6 +85,8 @@ public function back()
7785
* Example: And I move forward one page
7886
*
7987
* @When /^(?:|I )move forward one page$/
88+
*
89+
* @return void
8090
*/
8191
public function forward()
8292
{
@@ -89,6 +99,8 @@ public function forward()
8999
* Example: And I press "Log In"
90100
*
91101
* @When /^(?:|I )press "(?P<button>(?:[^"]|\\")*)"$/
102+
*
103+
* @return void
92104
*/
93105
public function pressButton($button)
94106
{
@@ -102,6 +114,8 @@ public function pressButton($button)
102114
* Example: And I follow "Log In"
103115
*
104116
* @When /^(?:|I )follow "(?P<link>(?:[^"]|\\")*)"$/
117+
*
118+
* @return void
105119
*/
106120
public function clickLink($link)
107121
{
@@ -117,6 +131,8 @@ public function clickLink($link)
117131
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
118132
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with:$/
119133
* @When /^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
134+
*
135+
* @return void
120136
*/
121137
public function fillField($field, $value)
122138
{
@@ -135,6 +151,8 @@ public function fillField($field, $value)
135151
* | password | iLoveBats123 |
136152
*
137153
* @When /^(?:|I )fill in the following:$/
154+
*
155+
* @return void
138156
*/
139157
public function fillFields(TableNode $fields)
140158
{
@@ -149,6 +167,8 @@ public function fillFields(TableNode $fields)
149167
* Example: And I select "Bats" from "user_fears"
150168
*
151169
* @When /^(?:|I )select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
170+
*
171+
* @return void
152172
*/
153173
public function selectOption($select, $option)
154174
{
@@ -163,6 +183,8 @@ public function selectOption($select, $option)
163183
* Example: And I additionally select "Deceased" from "parents_alive_status"
164184
*
165185
* @When /^(?:|I )additionally select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
186+
*
187+
* @return void
166188
*/
167189
public function additionallySelectOption($select, $option)
168190
{
@@ -177,6 +199,8 @@ public function additionallySelectOption($select, $option)
177199
* Example: And I check "Pearl Necklace"
178200
*
179201
* @When /^(?:|I )check "(?P<option>(?:[^"]|\\")*)"$/
202+
*
203+
* @return void
180204
*/
181205
public function checkOption($option)
182206
{
@@ -190,6 +214,8 @@ public function checkOption($option)
190214
* Example: And I uncheck "Broadway Plays"
191215
*
192216
* @When /^(?:|I )uncheck "(?P<option>(?:[^"]|\\")*)"$/
217+
*
218+
* @return void
193219
*/
194220
public function uncheckOption($option)
195221
{

src/Behat/MinkExtension/Context/RawMinkContext.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public function getMinkParameters()
6666
* Sets parameters provided for Mink.
6767
*
6868
* @param array $parameters
69+
*
70+
* @return void
6971
*/
7072
public function setMinkParameters(array $parameters)
7173
{
@@ -90,6 +92,8 @@ public function getMinkParameter($name)
9092
*
9193
* @param string $name The key of the parameter
9294
* @param string $value The value of the parameter
95+
*
96+
* @return void
9397
*/
9498
public function setMinkParameter($name, $value)
9599
{
@@ -125,6 +129,8 @@ public function assertSession($name = null)
125129
*
126130
* @param string $path
127131
* @param string|null $sessionName
132+
*
133+
* @return void
128134
*/
129135
public function visitPath($path, $sessionName = null)
130136
{
@@ -153,6 +159,8 @@ public function locatePath($path)
153159
* <browser_name>_<ISO 8601 date>_<randomId>.png
154160
* @param string $filepath Desired filepath, defaults to
155161
* upload_tmp_dir, falls back to sys_get_temp_dir()
162+
*
163+
* @return void
156164
*/
157165
public function saveScreenshot($filename = null, $filepath = null)
158166
{

src/Behat/MinkExtension/Listener/FailureShowListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public static function getSubscribedEvents()
6262
* @param AfterStepTested $event
6363
*
6464
* @throws \RuntimeException if show_cmd is not configured
65+
*
66+
* @return void
6567
*/
6668
public function showFailedStepResponse(AfterStepTested $event)
6769
{

src/Behat/MinkExtension/Listener/SessionsListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public static function getSubscribedEvents()
7979
* @param ScenarioLikeTested $event
8080
*
8181
* @throws ProcessingException when the @javascript tag is used without a javascript session
82+
*
83+
* @return void
8284
*/
8385
public function prepareDefaultMinkSession(ScenarioLikeTested $event)
8486
{
@@ -109,6 +111,8 @@ public function prepareDefaultMinkSession(ScenarioLikeTested $event)
109111

110112
/**
111113
* Stops all started Mink sessions.
114+
*
115+
* @return void
112116
*/
113117
public function tearDownMinkSessions()
114118
{

src/Behat/MinkExtension/ServiceContainer/Driver/DriverFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public function supportsJavascript();
3838
* Setups configuration for the driver factory.
3939
*
4040
* @param ArrayNodeDefinition $builder
41+
*
42+
* @return void
4143
*/
4244
public function configure(ArrayNodeDefinition $builder);
4345

0 commit comments

Comments
 (0)