Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camel caps format and blank lines #24

Closed
leonelfreire opened this issue Dec 11, 2012 · 8 comments
Closed

Camel caps format and blank lines #24

leonelfreire opened this issue Dec 11, 2012 · 8 comments
Labels

Comments

@leonelfreire
Copy link

Example:

<?php
class Test {

    private static $__myVar = 1;

    public static function getMyVar() {
        return self::$__myVar;
    }
}

Output:

FILE: test.php
------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
------------------------------------------------------------------
 7 | ERROR | Variable "__myVar" is not in valid camel caps format
 8 | ERROR | Expected 1 blank lines after function; 2 found
------------------------------------------------------------------
  • Error1: The name $__myVar is valid, but not when used with self::$__myVar or Test::$__myVar.
  • Error2: The message "Expected 1 blank" is OK, but "2 found"? Shouldn't be "0 found"?
@dereuromark
Copy link
Member

there shouldnt be any private methods and vars in the first place :)
at least not in a framework context

@ceeram
Copy link
Contributor

ceeram commented Dec 11, 2012

The standard can be used for applications as well.

@leonelfreire
Copy link
Author

I'm not talking about CakePHP code, but my own application code. I'm following the same coding style and I think this is a misbehaviour.

@ceeram
Copy link
Contributor

ceeram commented Dec 11, 2012

@leonelfreire Do you have latest version of both PHP_CodeSniffer 1.4.3 and cakephp/CakePHP_CodeSniffer 0.1.11 ?

@leonelfreire
Copy link
Author

Installed packages, channel pear.php.net:
=========================================
Package          Version State
PHP_CodeSniffer  1.4.3   stable
Installed packages, channel pear.cakephp.org:
=============================================
Package             Version State
CakePHP_CodeSniffer 0.1.11  stable

@ceeram
Copy link
Contributor

ceeram commented Dec 11, 2012

Thanks, im already looking into it

@leonelfreire
Copy link
Author

Thanks. ;-)

ceeram added a commit to ceeram/cakephp-codesniffer that referenced this issue Dec 11, 2012
ceeram added a commit that referenced this issue Dec 12, 2012
@ceeram
Copy link
Contributor

ceeram commented Dec 12, 2012

Fixed in eea7915

@ceeram ceeram closed this as completed Dec 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants