sabre-io / cs Goto Github PK
View Code? Open in Web Editor NEWsabre/cs provides coding standards for all sabre packages.
Home Page: http://sabre.io
License: BSD 3-Clause "New" or "Revised" License
sabre/cs provides coding standards for all sabre packages.
Home Page: http://sabre.io
License: BSD 3-Clause "New" or "Revised" License
static is the 'more important keyword' I believe, so it should be turned around.
Should we also use the ternary_spaces fixer?
Would e.g. enforce spaces for $a ? $b : $c
.
sabre/cs is based on php-cs-fixer 1.1 which is by now deprecated and not compatible with latest php versions (warnings are poping up on php7.3)
Porting sabre/cs to php-cs-fixer 2.0 is quite some effort since interfaces changed. From the first look it seems all custom fixer rules need to be reimplemented.
I hereby question the necessity of these custom rules and propose to deprecate sabre/CS and use pure php-cs-fixer.
Too many to name. See commit ;)
If there is no test, then we should remove the tests/
directory :-).
I've done this so incredibly inconsistently, that it makes sense to finally make a decision here.
I don't know what looks nicer anymore, I've been going back and forward. Because of this, it's better to pick one: lets go for the PSR-2 approach.
PSR-2 dictates that every import must have 1 use statement.
Because php-cs-fixer automatically skips vendor/
, we can safely do:
$ bin/sabre-cs-fixer fix --dry-run --diff .
It will include the tests/
directory this way. And it's much better. All projects must update to this way of doing.
We don't like these whitespaces:
if ()
for ()
foreach ()
while ()
catch ()
function ()
Creating a ticket so people see the change and might want to argue.
Currently the CS fixer will change this:
$foo = 1;
$longvariable = 2;
to
$foo = 1;
$longvariable = 2;
While I think this is totally more legible in some blocks of code, especially blocks where there's many similar things being defined, I don't think it should be applied everywhere. So I'd want to remove this rule.
@DominikTo found out that public properties cause internal errors in sabre-cs-fixer.
class Foo
{
}
Is currently not automatically fixed into:
class Foo {
}
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.