Giter VIP home page Giter VIP logo

Comments (15)

mlocati avatar mlocati commented on August 11, 2024

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.

WinterSilence avatar WinterSilence commented on August 11, 2024

изображение

from php-cs-fixer-configurator.

mlocati avatar mlocati commented on August 11, 2024

Yep, those values are in PHP format

from php-cs-fixer-configurator.

WinterSilence avatar WinterSilence commented on August 11, 2024

@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.

mlocati avatar mlocati commented on August 11, 2024

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.

WinterSilence avatar WinterSilence commented on August 11, 2024

@mlocati

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.

WinterSilence avatar WinterSilence commented on August 11, 2024

@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.

mlocati avatar mlocati commented on August 11, 2024

The whole app is client-side only, so it can only use Javascript, not PHP

from php-cs-fixer-configurator.

mlocati avatar mlocati commented on August 11, 2024

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.

WinterSilence avatar WinterSilence commented on August 11, 2024

@mlocati

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.

mlocati avatar mlocati commented on August 11, 2024

May be use combo format?

// $array = '['a', 'b',]'
$array = strtr($array, ["'" => '"', ',]' => ']']);

Where?

from php-cs-fixer-configurator.

WinterSilence avatar WinterSilence commented on August 11, 2024

@mlocati I'm lose 'Something like this:'. Sorry, I'm dont know typescript and cant help to you

from php-cs-fixer-configurator.

WinterSilence avatar WinterSilence commented on August 11, 2024

@mlocati update: dirty fix, for example arr = arr.replace(/'/, '"').replace(/,\]/, ']');

from php-cs-fixer-configurator.

WinterSilence avatar WinterSilence commented on August 11, 2024

@mlocati

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.

mlocati avatar mlocati commented on August 11, 2024

I'm going to close this because:

  1. 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)
  2. 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)
  3. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.