Comments (6)
I think I get your point, but then it looks like a small edge-case to me. I don't think we'll invest time on this so I'd suggest not using no_trailing_whitespace_in_string
and maybe creating a custom rule.
from php-cs-fixer.
why a single whitespace is non-risky, while 2 whitespaces are risky?
from php-cs-fixer.
For later readability single space is better and it wont break if text is used as SQL command or exec commands ect.
Example using SQL in string
--- Original
+++ New
-<?php $a = 'SELECT
-id
-name
-address
+<?php $a = 'SELECT
+id
+name
+address
from php-cs-fixer.
Why do you need to keep one space instead of removing all? What difference does it make for e.g. SQL?
from php-cs-fixer.
I'm just trying to make examples of how this could be improved if the coder has accidentally inserted unnecessary spaces.
I have lot of diffirent kind of legacy ugly code with those unnecessary spaces and it would be great if fixer could remove them without breaking world.
SQL parsing from parts. Not real life example.
$select = 'SELECT '; // Can be trimmed down to one space.
$columns = '
id
name
'; // Can be trimmed down to one space.
$where = 'WHERE '; // Broke SQL if space trimmed. So it needed to keep here.
$whereColumns = ' id=1';
from php-cs-fixer.
Agree.
Please continue with @julienfalque suggestion.
Thanks!
from php-cs-fixer.
Related Issues (20)
- Displaying sum memory usage from all workers when parallel runner is used HOT 1
- Install documentation misses recommended "tools/php-cs-fixer" dir method HOT 5
- `ParallelConfigFactory` using named parameters behaves unexpectedly when omiting first argument
- `statement_indentation` and arrays defined in a multiline const breaks indentation
- The phpExecutable config is no longer used HOT 9
- Improve cookbook about creating custom fixers HOT 1
- Conflicting rules with PHPUnit fixers (?) HOT 2
- Unable to sort group_import by length
- `simplified_null_return` errors out with `TypeError: Illegal offset type` HOT 6
- Improve stack trace when running the tool with parallel runner HOT 6
- Error regarding conflicting fixers HOT 4
- phpdoc_align not aligning to left on multiline descriptions
- phpcs wants to rewrite a class constant named NULL HOT 4
- constant_case rule changes consts name HOT 4
- Cache is ignored by the parallel runner when using certain cachefile paths
- `simple_to_complex_string_variable` does not fix complex variable HOT 1
- Buffer size exceeded exceptions when running in parallel HOT 6
- `no_unused_imports` - Globally-Namespaced Unused Imports Are Not Removed When Mentioned in a DocComment HOT 1
- `PhpUnitAttributesFixer` is not fining multiple same groups HOT 1
- Match -> switch rule and fixer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-cs-fixer.