bedrockstreaming / symfony2-coding-standard Goto Github PK
View Code? Open in Web Editor NEWThis project forked from lapistano/symfony2-coding-standard
:no_entry: DEPRECATED - Symfony2-coding-standard
License: MIT License
This project forked from lapistano/symfony2-coding-standard
:no_entry: DEPRECATED - Symfony2-coding-standard
License: MIT License
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)
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);
});
}
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 😄
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.
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 ?
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 ?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.