1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 08:58:55 +02: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:
Joshua Spence 2015-06-25 07:09:17 +10:00
parent b697a3b80b
commit 04d788c79e
2 changed files with 6 additions and 0 deletions

View file

@ -22,6 +22,8 @@ if ($x) {
do {
echo 1;
} while(true);
try {} catch(Exception $ex) {}
~~~~~~~~~~
warning:2:1
warning:2:10
@ -37,6 +39,7 @@ warning:10:16
warning:13:3
warning:14:3
warning:24:3
warning:26:8
~~~~~~~~~~
<?php
if ($x) {} else {}
@ -57,3 +60,5 @@ if ($x) {
do {
echo 1;
} while (true);
try {} catch (Exception $ex) {}

View file

@ -23,6 +23,7 @@ final class ArcanistControlStatementSpacingXHPASTLinterRule
case 'T_WHILE':
case 'T_DO':
case 'T_SWITCH':
case 'T_CATCH':
$after = $token->getNonsemanticTokensAfter();
if (empty($after)) {
$this->raiseLintAtToken(