Top "Psr-2" questions

PSR-2 is a PHP Standards Recommendation containing PHP's Coding Style Guide.

What is the difference between StudlyCaps and CamelCase?

PSR suggests, method names MUST be declared in camelCase and class names MUST be declared in StudlyCaps.

psr-2 psr-1
Add an empty line at end of file according to PSR-2 on PhpStorm

I use PSR-2 for code styling my code. When I inspect a file using Codesniffer most of the times I …

php phpstorm codesniffer phpcodesniffer psr-2
PSR-2 if-statement — what is allowed?

Can I use if-statement like: if(true) return $value; Or must use always with braces: if(true) { return $value; }

php if-statement psr-2
Objective reasons for using spaces instead of tabs for indentation?

Are there objective reasons for using spaces instead of tabs for indenting files as per PSR-2 standard, can someone provide: …

php code-formatting psr-2
What are the main differences between the PSR-2 coding standard and the Symfony2 code standard for phpcs?

I am trying to figure out which code style to enforce with the phpcs code sniffer. Since the popularity of …

php symfony coding-style codesniffer psr-2
Are parentheses required in PSR-2 PHP ternary syntax?

Question: are parentheses required in PSR-2 PHP ternary syntax? Looking for which (if either) of the following ternary statement's syntax …

php psr-2 psr-1