Skip to content

Commit d606fb0

Browse files
Wilfredfacebook-github-bot
authored andcommitted
Improve wording for lint on all paths returning the same value
Summary: Users were interpreting the previous message as "early returns are bad", whereas the intent is "if you're always returning the same value, something is probably wrong". Reviewed By: scotthovestadt Differential Revision: D38948920 fbshipit-source-id: e490d8ead1ad0a92937e3af703d0374c41941b9c
1 parent 4796bc1 commit d606fb0

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

hphp/hack/src/lints/lints_errors.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,4 @@ let branches_return_same_value p =
476476
Codes.branch_return_same_value
477477
Lint_warning
478478
p
479-
"All of these statements are returning the same value. Consider keeping a single return statement outside of the branches."
479+
"There are multiple return statements, but they all return the same value."
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
11
File "branches_returning_same_value.php", line 12, characters 12-14:
2-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
2+
There are multiple return statements, but they all return the same value. (Lint[5646])
33
File "branches_returning_same_value.php", line 14, characters 12-14:
4-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
4+
There are multiple return statements, but they all return the same value. (Lint[5646])
55
File "branches_returning_same_value.php", line 20, characters 12-18:
6-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
6+
There are multiple return statements, but they all return the same value. (Lint[5646])
77
File "branches_returning_same_value.php", line 22, characters 12-18:
8-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
8+
There are multiple return statements, but they all return the same value. (Lint[5646])
99
File "branches_returning_same_value.php", line 29, characters 12-14:
10-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
10+
There are multiple return statements, but they all return the same value. (Lint[5646])
1111
File "branches_returning_same_value.php", line 31, characters 12-14:
12-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
12+
There are multiple return statements, but they all return the same value. (Lint[5646])
1313
File "branches_returning_same_value.php", line 38, characters 12-15:
14-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
14+
There are multiple return statements, but they all return the same value. (Lint[5646])
1515
File "branches_returning_same_value.php", line 41, characters 12-15:
16-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
16+
There are multiple return statements, but they all return the same value. (Lint[5646])
1717
File "branches_returning_same_value.php", line 47, characters 12-23:
18-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
18+
There are multiple return statements, but they all return the same value. (Lint[5646])
1919
File "branches_returning_same_value.php", line 49, characters 12-23:
20-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
20+
There are multiple return statements, but they all return the same value. (Lint[5646])
2121
File "branches_returning_same_value.php", line 55, characters 12-24:
22-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
22+
There are multiple return statements, but they all return the same value. (Lint[5646])
2323
File "branches_returning_same_value.php", line 57, characters 12-24:
24-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
24+
There are multiple return statements, but they all return the same value. (Lint[5646])
2525
File "branches_returning_same_value.php", line 95, characters 12-14:
26-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
26+
There are multiple return statements, but they all return the same value. (Lint[5646])
2727
File "branches_returning_same_value.php", line 97, characters 10-12:
28-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
28+
There are multiple return statements, but they all return the same value. (Lint[5646])
2929
File "branches_returning_same_value.php", line 102, characters 12-18:
30-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
30+
There are multiple return statements, but they all return the same value. (Lint[5646])
3131
File "branches_returning_same_value.php", line 104, characters 12-18:
32-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
32+
There are multiple return statements, but they all return the same value. (Lint[5646])
3333
File "branches_returning_same_value.php", line 106, characters 12-18:
34-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
34+
There are multiple return statements, but they all return the same value. (Lint[5646])
3535
File "branches_returning_same_value.php", line 125, characters 12-18:
36-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
36+
There are multiple return statements, but they all return the same value. (Lint[5646])
3737
File "branches_returning_same_value.php", line 130, characters 10-16:
38-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
38+
There are multiple return statements, but they all return the same value. (Lint[5646])
3939
File "branches_returning_same_value.php", line 136, characters 12-18:
40-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
40+
There are multiple return statements, but they all return the same value. (Lint[5646])
4141
File "branches_returning_same_value.php", line 141, characters 10-16:
42-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
42+
There are multiple return statements, but they all return the same value. (Lint[5646])
4343
File "branches_returning_same_value.php", line 147, characters 14-20:
44-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
44+
There are multiple return statements, but they all return the same value. (Lint[5646])
4545
File "branches_returning_same_value.php", line 149, characters 12-18:
46-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
46+
There are multiple return statements, but they all return the same value. (Lint[5646])
4747
File "branches_returning_same_value.php", line 151, characters 12-18:
48-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
48+
There are multiple return statements, but they all return the same value. (Lint[5646])
4949
File "branches_returning_same_value.php", line 153, characters 12-18:
50-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
50+
There are multiple return statements, but they all return the same value. (Lint[5646])
5151
File "branches_returning_same_value.php", line 175, characters 14-16:
52-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
52+
There are multiple return statements, but they all return the same value. (Lint[5646])
5353
File "branches_returning_same_value.php", line 177, characters 14-16:
54-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
54+
There are multiple return statements, but they all return the same value. (Lint[5646])
5555
File "branches_returning_same_value.php", line 183, characters 14-20:
56-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
56+
There are multiple return statements, but they all return the same value. (Lint[5646])
5757
File "branches_returning_same_value.php", line 185, characters 14-20:
58-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
58+
There are multiple return statements, but they all return the same value. (Lint[5646])
5959
File "branches_returning_same_value.php", line 192, characters 14-16:
60-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
60+
There are multiple return statements, but they all return the same value. (Lint[5646])
6161
File "branches_returning_same_value.php", line 194, characters 14-16:
62-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
62+
There are multiple return statements, but they all return the same value. (Lint[5646])
6363
File "branches_returning_same_value.php", line 201, characters 14-17:
64-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
64+
There are multiple return statements, but they all return the same value. (Lint[5646])
6565
File "branches_returning_same_value.php", line 204, characters 14-17:
66-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
66+
There are multiple return statements, but they all return the same value. (Lint[5646])
6767
File "branches_returning_same_value.php", line 210, characters 14-25:
68-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
68+
There are multiple return statements, but they all return the same value. (Lint[5646])
6969
File "branches_returning_same_value.php", line 212, characters 14-25:
70-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
70+
There are multiple return statements, but they all return the same value. (Lint[5646])
7171
File "branches_returning_same_value.php", line 218, characters 14-26:
72-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
72+
There are multiple return statements, but they all return the same value. (Lint[5646])
7373
File "branches_returning_same_value.php", line 220, characters 14-26:
74-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
74+
There are multiple return statements, but they all return the same value. (Lint[5646])
7575
File "branches_returning_same_value.php", line 258, characters 14-20:
76-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
76+
There are multiple return statements, but they all return the same value. (Lint[5646])
7777
File "branches_returning_same_value.php", line 260, characters 14-20:
78-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
78+
There are multiple return statements, but they all return the same value. (Lint[5646])
7979
File "branches_returning_same_value.php", line 262, characters 14-20:
80-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
80+
There are multiple return statements, but they all return the same value. (Lint[5646])
8181
File "branches_returning_same_value.php", line 281, characters 14-20:
82-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
82+
There are multiple return statements, but they all return the same value. (Lint[5646])
8383
File "branches_returning_same_value.php", line 286, characters 12-18:
84-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
84+
There are multiple return statements, but they all return the same value. (Lint[5646])
8585
File "branches_returning_same_value.php", line 292, characters 14-20:
86-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
86+
There are multiple return statements, but they all return the same value. (Lint[5646])
8787
File "branches_returning_same_value.php", line 297, characters 12-18:
88-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
88+
There are multiple return statements, but they all return the same value. (Lint[5646])
8989
File "branches_returning_same_value.php", line 302, characters 14-16:
90-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
90+
There are multiple return statements, but they all return the same value. (Lint[5646])
9191
File "branches_returning_same_value.php", line 304, characters 12-14:
92-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
92+
There are multiple return statements, but they all return the same value. (Lint[5646])
9393
File "branches_returning_same_value.php", line 309, characters 16-22:
94-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
94+
There are multiple return statements, but they all return the same value. (Lint[5646])
9595
File "branches_returning_same_value.php", line 311, characters 14-20:
96-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
96+
There are multiple return statements, but they all return the same value. (Lint[5646])
9797
File "branches_returning_same_value.php", line 313, characters 14-20:
98-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
98+
There are multiple return statements, but they all return the same value. (Lint[5646])
9999
File "branches_returning_same_value.php", line 315, characters 14-20:
100-
All of these statements are returning the same value. Consider keeping a single return statement outside of the branches. (Lint[5646])
100+
There are multiple return statements, but they all return the same value. (Lint[5646])

0 commit comments

Comments
 (0)