mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Ensure that a space is used after a catch token
Summary: For consistency, a single space should separate `catch` and the following parenthetical expression. Test Plan: Added test case. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13389
This commit is contained in:
parent
b697a3b80b
commit
04d788c79e
2 changed files with 6 additions and 0 deletions
|
@ -22,6 +22,8 @@ if ($x) {
|
||||||
do {
|
do {
|
||||||
echo 1;
|
echo 1;
|
||||||
} while(true);
|
} while(true);
|
||||||
|
|
||||||
|
try {} catch(Exception $ex) {}
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
warning:2:1
|
warning:2:1
|
||||||
warning:2:10
|
warning:2:10
|
||||||
|
@ -37,6 +39,7 @@ warning:10:16
|
||||||
warning:13:3
|
warning:13:3
|
||||||
warning:14:3
|
warning:14:3
|
||||||
warning:24:3
|
warning:24:3
|
||||||
|
warning:26:8
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
<?php
|
<?php
|
||||||
if ($x) {} else {}
|
if ($x) {} else {}
|
||||||
|
@ -57,3 +60,5 @@ if ($x) {
|
||||||
do {
|
do {
|
||||||
echo 1;
|
echo 1;
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
|
try {} catch (Exception $ex) {}
|
||||||
|
|
|
@ -23,6 +23,7 @@ final class ArcanistControlStatementSpacingXHPASTLinterRule
|
||||||
case 'T_WHILE':
|
case 'T_WHILE':
|
||||||
case 'T_DO':
|
case 'T_DO':
|
||||||
case 'T_SWITCH':
|
case 'T_SWITCH':
|
||||||
|
case 'T_CATCH':
|
||||||
$after = $token->getNonsemanticTokensAfter();
|
$after = $token->getNonsemanticTokensAfter();
|
||||||
if (empty($after)) {
|
if (empty($after)) {
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
|
|
Loading…
Reference in a new issue