GithubHelp home page GithubHelp logo

bedrockstreaming / symfony2-coding-standard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lapistano/symfony2-coding-standard

17.0 17.0 7.0 70 KB

:no_entry: DEPRECATED - Symfony2-coding-standard

License: MIT License

PHP 99.33% SourcePawn 0.67%

symfony2-coding-standard's People

Contributors

ad7six avatar asm89 avatar bobthecow avatar davehauenstein avatar fabpot avatar fbrandt avatar fdubost avatar francisbesset avatar jdlabails avatar ktomk avatar merk avatar mikaelrandy avatar pborreli avatar pvankouteren avatar qpleple avatar robocoder avatar t-geindre avatar woecifaun avatar xgorse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

symfony2-coding-standard's Issues

Not compatible with CS 2.0+

There are issues with method signature differences beween this project and the new version of CS.

Eg:
PHP Strict Standards: Declaration of Symfony2_Sniffs_Commenting_FunctionCommentSniff::processReturn() should be compatible with PEAR_Sniffs_Commenting_FunctionCommentSniff::processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart)

Code Sniffer asks for a @return tag while the method doesnt return anything

Consider the following snippet:

    /**
     * @param array $c
     */
    protected function parseClipData(array &$c)
    {
        usort($c, function ($a, $b) {
            return strtotime($b) - strtotime($a);
        });
    }

Coding standard should be OK with this.

But here is its output:

ERROR | Missing @return tag in function comment

Because it sees the return statement in the closure, it requires us to add a @return phpDoc tag in our function like the following, even if the function does not return anything:

    /**
     * @param array $c
     *
     * @return void
     */
    protected function parseClipData(array &$c)
    {
        usort($c, function ($a, $b) {
            return strtotime($b) - strtotime($a);
        });
    }

Multiline argument list for method definition not PSR-2 compatible

As stated in the section 4.4. Method Arguments of the PSR-2, the closing parenthese and the open brace should be on the same line, just underneath the last argument.

When doing so, I encounter the following error
ERROR | Opening brace should be on a new line

I don't know where to look for in order to do a PR. Any hint welcome.

thanks again for the coke 😄

Missing Composer dependency

When installing this package with composer as a dependency to something else in my project, I get the following:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for m6web/symfony2-coding-standard dev-master@dev -> satisfiable by m6web/symfony2-coding-standard[dev-master].
    - m6web/symfony2-coding-standard dev-master requires squizlabs/php_codesniffer ~1.0 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

According to Packagist: https://packagist.org/packages/squizlabs/php_codesniffer

it looks like the oldest version available is 1.4.2. Would it work to depend on 1.*?

I would submit a pull request,but I don't know if 1.4.2 is compatible or not. This is actually a dependency of a dependency of a dependency of the package I'm really trying to install.

Future of param & return docblocks with PHP7

Hey,

On PHP5 we had :

    /**
     * @param Request $request
     *
     * @Route("/queue/wanna-speak/process", name="ws_queue")
     * @Method({"GET"})
     *
     * @return Response
     */
    public function queueAction(Request $request)
    {
        return new Response();
    }

on PHP7 we can simplify this by using:

    /**
     * @Route("/queue/wanna-speak/process", name="ws_queue")
     * @Method({"GET"})
     */
    public function queueAction(Request $request): Response
    {
        return new Response();
    }

Since we can take advantage on advanced type hinting AND return types, the functions/methods can now contains everything we need (parameters & returns) to not write the @param and @return docblock

What do you think of dropping those rules ?

Liste des règles spécifiques

Serait-il possible d'avoir une liste des règles ajoutées ou supprimées par rapport aux standards stricts de Symfony, dans le README ?

Please update version number in README

Should it be "m6web/coke":"~3" and "m6web/Symfony2-coding-standard": "~3" for example, instead of "m6web/coke": "~1.1" and "m6web/Symfony2-coding-standard": "~1.1" ?

When I use the composer.json with lower version numbers, I get coke v1.2.2 and symfony2-coding-standard v1.2.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.