Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Class name that close immediatly do not pass test #74

Open
marcghorayeb opened this Issue · 3 comments

2 participants

@marcghorayeb

My file:

<?php

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?

@blainesch
Collaborator

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?

@marcghorayeb

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

@blainesch
Collaborator

@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 .+ )?{}?\$/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.