Class name that close immediatly do not pass test #74

marcghorayeb opened this Issue Apr 11, 2013 · 3 comments

3 participants

Union of RAD member

My file:


namespace app\models;

class AbActions extends \sc_common\models\AbActions {}


It doesn't understand that I close the class immediatly on the same line, is this a serious issue?

Union of RAD member

I see the issue. We could fix the use statement issue by changing:

-if (preg_match('/^use (?:([^ ]+ as )|(.*\\\))?(.*);$/i', $line, $matches) === 1) {
+if (preg_match('/^use (?:([^ ]+[ ]+as[ ]+)|(.*\\\))?(.*);$/i', $line, $matches) === 1) {

I think if we do this it should also be added to ControlStructuresHaveCorrectSpacing. It's name has already lost it's meaning.

T_CLASS => array(
    'message' => 'Unexpected T_USE format. Should be: "use foo as bar;" or "use foo;"',
    'patterns' => array(
        "/^use (?:([^ ]+ as )|(.*\\\))?(.*);$/i",

I'll update later, unless you want to tackle a pr?

Union of RAD member

@BlaineSch I think you meant to respond to #73 ? :)

Union of RAD member

@marcghorayeb yes, sorry [:

The same class needs to be modified for this as well though. Link

-"/^{:whitespace}(?:abstract )?class [^\s]+ (extends [\S]+ )?(implements .+ )?{\$/"
+"/^{:whitespace}(?:abstract )?class [^\s]+ (extends [\S]+ )?(implements .+ )?{}?\$/"
@davidpersson davidpersson added the Bug label Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment