1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-09 14:21:01 +01:00
phorge-arcanist/src/lint/linter
Joshua Spence 3ac313ad1e Write a linter rule for unexpected return values
Summary:
Although it is technically possible to return a value from a PHP constructor, it is rather odd and should be avoided. See some discussion on [[http://stackoverflow.com/q/11904255 | StackOverflow]]. Consider the following example:

```lang=php
class SomeClass {
  public function __construct() {
    return 'quack';
  }
}
```

This doesn't work:

```lang=php, counterexample
echo new SomeClas();
```

This, strangely, does work:

```lang=php
echo id(new SomeClass())->__construct();
```

Test Plan: Added unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14516
2015-11-19 19:34:32 +11:00
..
__tests__ Test XHPAST linter rules in isolation 2015-11-19 08:57:23 +11:00
exception Move linter exception classes to src/lint/linter/exception 2015-01-12 06:46:23 +11:00
standards Fold ArcanistPhutilXHPASTLinter into ArcanistXHPASTLinter 2015-11-13 07:08:40 +11:00
xhpast Write a linter rule for unexpected return values 2015-11-19 19:34:32 +11:00
ArcanistBaseXHPASTLinter.php Split the ArcanistXHPASTLinter into modular rules 2015-06-01 15:49:16 +10:00
ArcanistChmodLinter.php Add unit tests for ArcanistChmodLinter 2015-01-15 06:58:11 +11:00
ArcanistClosureLinter.php Fix ArcanistClosureLinter 2015-10-02 05:45:48 -07:00
ArcanistCoffeeLintLinter.php Improve behavior for detecting the failure to parse external linter output 2015-05-22 07:30:17 +10:00
ArcanistComposerLinter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistCppcheckLinter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistCpplintLinter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistCSharpLinter.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistCSSLintLinter.php Fix ArcanistCSSLintLinter issue for messages without line number 2015-11-17 07:14:13 -08:00
ArcanistExternalLinter.php External linters can now specify a version requirement. 2015-10-21 09:46:20 -07:00
ArcanistFilenameLinter.php Fix visibility of various ArcanistLinter methods 2015-01-07 07:36:07 +11:00
ArcanistFlake8Linter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistFutureLinter.php Split large path lists into blocks when linting 2015-04-22 05:15:57 -07:00
ArcanistGeneratedLinter.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistGoLintLinter.php Set path on more linters 2015-10-02 08:58:15 -07:00
ArcanistHLintLinter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistInlineHTMLXHPASTLinterRule.php Improve the "inline HTML" linter rule 2015-08-19 15:34:43 +10:00
ArcanistJscsLinter.php Set path on more linters 2015-10-02 08:58:15 -07:00
ArcanistJSHintLinter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistJSONLinter.php phtize a bunch more strings 2015-05-22 17:09:56 +10:00
ArcanistJSONLintLinter.php Set path on more linters 2015-10-02 08:58:15 -07:00
ArcanistLesscLinter.php More linter's short description 2015-09-14 11:52:24 -07:00
ArcanistLinter.php Test XHPAST linter rules in isolation 2015-11-19 08:57:23 +11:00
ArcanistMergeConflictLinter.php Minor reordering of functions 2014-09-22 18:42:41 +10:00
ArcanistNoLintLinter.php Remove severity options from some linters. 2014-05-11 19:28:27 -07:00
ArcanistPEP8Linter.php More linter's short description 2015-09-14 11:52:24 -07:00
ArcanistPhpcsLinter.php Improve validation of 'name' and 'code' parameters for lint messages 2015-09-25 11:16:04 -07:00
ArcanistPhpLinter.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistPhutilLibraryLinter.php phtize a bunch more strings 2015-05-22 17:09:56 +10:00
ArcanistPuppetLintLinter.php Improve behavior for detecting the failure to parse external linter output 2015-05-22 07:30:17 +10:00
ArcanistPyFlakesLinter.php Set path on more linters 2015-10-02 08:58:15 -07:00
ArcanistPyLintLinter.php Recover from PyLint raising messages at character "-1" 2015-08-24 21:11:54 -07:00
ArcanistRuboCopLinter.php update linter short desc 2015-09-08 14:52:43 -07:00
ArcanistRubyLinter.php Improve behavior for detecting the failure to parse external linter output 2015-05-22 07:30:17 +10:00
ArcanistScriptAndRegexLinter.php Allow Script-and-Regex linter to have optional/empty capturing patterns for char/line 2015-10-19 14:35:14 -07:00
ArcanistSpellingLinter.php Test XHPAST linter rules in isolation 2015-11-19 08:57:23 +11:00
ArcanistTextLinter.php Add a linter rule for detecting empty files 2015-09-01 19:30:55 +10:00
ArcanistXHPASTLinter.php Test XHPAST linter rules in isolation 2015-11-19 08:57:23 +11:00
ArcanistXMLLinter.php pht all the things 2015-05-13 21:00:53 +10:00
reporter.js Don't use error context from JSHint in linter messages 2014-06-23 10:33:01 +10:00