Comments (15)
Where do you see this code?
Please remark that somewhere I display the values in PHP format, not in JSON format (and this seems PHP format).
from php-cs-fixer-configurator.
from php-cs-fixer-configurator.
Yep, those values are in PHP format
from php-cs-fixer-configurator.
@mlocati my mistake, but in config tab:
Please specify a value of type array in JSON format:
it's confuse me
from php-cs-fixer-configurator.
Yep, data is displayed in PHP format (because it's the format that PHP users are most familiar with), but when you configure the fixes you have to specify the data in JSON format (because parsing JSON is much more easy via JavaScript).
from php-cs-fixer-configurator.
but when you configure the fixes you have to specify the data in JSON format
Look to token_get_all()
.
May be use combo format?
// $array = '['a', 'b',]'
$array = strtr($array, ["'" => '"', ',]' => ']']);
from php-cs-fixer-configurator.
@mlocati also can u add ruleset @psr12
?
https://www.tomasvotruba.com/blog/2018/04/09/try-psr-12-on-your-code-today/
https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4502
it's not official and maybe not complete list, but i use it half year and dont find problems + CodeSniffer use same rules - i check it.
from php-cs-fixer-configurator.
The whole app is client-side only, so it can only use Javascript, not PHP
from php-cs-fixer-configurator.
The fixer sets are only extracted from Php-Cs-Fixer code, there's not support for custom sets. But I guess that in the near future Php-Cs-Fixer will provide a PSR-12 fixer set
from php-cs-fixer-configurator.
The whole app is client-side only, so it can only use Javascript, not PHP
I'm talk about normalize user inputs, not exported configuration
from php-cs-fixer-configurator.
May be use combo format?
// $array = '['a', 'b',]'
$array = strtr($array, ["'" => '"', ',]' => ']']);
Where?
from php-cs-fixer-configurator.
@mlocati I'm lose 'Something like this:'. Sorry, I'm dont know typescript and cant help to you
from php-cs-fixer-configurator.
@mlocati update: dirty fix, for example arr = arr.replace(/'/, '"').replace(/,\]/, ']');
from php-cs-fixer-configurator.
But I guess that in the near future Php-Cs-Fixer will provide a PSR-12 fixer set
as you can see (second link) it's not near future and it's jam long time ago
from php-cs-fixer-configurator.
I'm going to close this because:
- I'm not going to create my own fixer set for PSR-12. PHP-CS-Fixer Configurator is "just" a wrapper around php-cs-fixer data, it's not meant to do anything else (I don't have time to maintain custom fixer set rules)
- the examples display values in PHP format, since this configurator is meant to help PHP developers in writing php-cs-fixer rules (which should be written in PHP)
- when you use PHP-CS-Fixer Configurator to create the php-cs-fixer rules, and you need to specify the options of the rules, PHP-CS-Fixer Configurator accepts JSON data (because it's written TypeScript, where there's no easy way to parse PHP code)
from php-cs-fixer-configurator.
Related Issues (20)
- Discover "new" fixers more easily HOT 5
- Support for CS Fixer 2.16 HOT 3
- Donation Via Bitcoin HOT 1
- Cant delete excluded rules HOT 3
- Losing required properties of rules HOT 5
- No blank lines between properties HOT 1
- Support for Symfony ContainerConfigurator HOT 2
- Ability to hide unused deprecated rules HOT 3
- Highlight 'Disabled fixers (manually)' in darker red HOT 2
- Meaning of the 'red rules' HOT 4
- Add option for empty one-line constructor support
- Being able to show "not in" HOT 1
- Impossible to set option custom value in `blank_lines_before_namespace` HOT 1
- Commit `composer.lock` HOT 2
- Add php-cs-fixer for the PHP part of the project HOT 1
- `t.enabled undefined` on Style-CI export without rules
- Bug indent select HOT 1
- Modal bug HOT 3
- Validating the type of custom value of a fixer parameter HOT 1
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-configurator.