Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Joyce Babu
    @JoyceBabu

    I can see the indentation_type fixer

    * indentation_type [@PSR2, @Symfony]
      | Code MUST use configured indentation type.

    But how do I configure the indentation type? If I try to set 'indentation_type' => 'tab', I am getting the error

    [indentation_type] Is not configurable.

    Joyce Babu
    @JoyceBabu
    Okay, I found it. PhpCsFixer\Config::create()->setIndent("\t")
    Dariusz Rumiński
    @keradus
    :D
    Dariusz Rumiński
    @keradus
    This message was deleted
    Daniel Siepmann
    @DanielSiepmann
    Hi everyone, can someone explain the difference to https://github.com/squizlabs/PHP_CodeSniffer/ ? Or is it documented somewhere?
    Dariusz Rumiński
    @keradus
    Hi. I do not believe that you will find nice and objective comparison.
    Historically: when PHP CodeSniffer only detect issues, PHP CS Fixer already fixes them, later on PHP CodeSniffer started to fix them as well
    Who's behind: PHP CodeSniffer is inhouse software made in squiz company by one guy, PHP CS Fixer grow up from Symfony community and now it's driven by it's own community
    Purpose: While PHP CS Fixer is a one-purpose tool (fix violations in PHP code), PHP CodeSniffer has many purposes - fixing some issues, detecting other issues, and... do the same for CSS and JS, doing it quite poorly and ignoring facts that there are better, single-purpose tools to do it, like ESLint for JS
    Daniel Siepmann
    @DanielSiepmann
    Thanks @keradus that are enough information for me. Just wondered why there are two tools doing (kind of) the same. I didn't know the history.
    Dariusz Rumiński
    @keradus
    Somewhere about v0.5 we proposed that as we are fixing and they are only detecting, we could combine forces, squiz refused
    Actually, there are few more tools like this for php ;)
    Daniel Siepmann
    @DanielSiepmann
    I couldn't find any that: a) are already Integrated into IDEs and editors in such a good way and b) can generate a report / detect and optinally fix. Currently we are working with code sniffer as a code migration tool: https://github.com/DanielSiepmann/automated-typo3-update but if something else would be a better solution we might switch. In addition phpcs offers a way to integrate further tokeinzer to also work on further languages. E.g. typoscript which is special for TYPO3. This way we would be able to also migrate the configuration of TYPO3.
    Dariusz Rumiński
    @keradus

    integration are done by plugins, i think for any tools that fixes CS ;) also, most of IDE allows you to run custom binaries

    PHP CS Fixer could detect (dry-run), fix (regular run), and generate reports in json, junit (eg for Jenkins), xml and simple txt

    we have tokenizer component, but it's dedicated for PHP language, not sure would it be useful for typoscript, don't know what is that ;)

    but, btw, nice idea for axiomatization of CMS framework ;)
    Daniel Siepmann
    @DanielSiepmann
    I'll take a deeper look at the php cs fixer. As the company we are building the solution for already is using the fixer. That's why I was interested in the differences.
    Dariusz Rumiński
    @keradus
    sure thing ;)
    if i get it right - the typoscript is template language?
    if so, if you really want to have one tool to fix PHP and typoscript - then PHP CS Fixer would not do that (you could abuse code infrastructure to do it, but it's pointless).
    Daniel Siepmann
    @DanielSiepmann
    It's just an idea. The most important part is the php stuff. But typoscript would be a nice addition. We are currently trying to integrate it into phpcs. There is already another project which parses typoscript using a tokenizer. So we might use this, adjust the generated structure and would be able to use phpcs. But we didn't finished it yet
    Dariusz Rumiński
    @keradus
    SpacePossum
    @SpacePossum
    nice : D
    Julien Falque
    @julienfalque
    hi there
    anyone comfortable with Doctrine Annotation willing to review these PRs? that would help :)
    Dariusz Rumiński
    @keradus
    I just noticed this:
    Time: 21.76 seconds, Memory: 68.00MB
    
    OK, but incomplete, skipped, or risky tests!
    Tests: 9502, Assertions: 200537, Skipped: 22, Incomplete: 22.
    close to 10k tests, >200k assertions :D
    Dariusz Rumiński
    @keradus
    I integrated CircleCI to try out running CI on MacOS as well (Currently, we have Ubuntu + Windows):
    FriendsOfPHP/PHP-CS-Fixer#2932
    all help is welcome
    Muah
    @ctf0

    hi there, whats the rule responsible for changing

     ], function () {

    into

    ],
        function () {

    it was working b4 the last update, now array square doesnt allow having anything else on the same line

    Dariusz Rumiński
    @keradus
    Hi.
    What do you mean by last update? we released 3 different versions at same time.
    Easiest way to identify it would be to have that unchanged code in file and run php-cs-fixer fix file -vvv, with verbosity you will see rule names that modified the file
    Muah
    @ctf0
    awesome, thanx
    Dariusz Rumiński
    @keradus

    on master:

    Time: 19.32 seconds, Memory: 76.00MB
    
    OK, but incomplete, skipped, or risky tests!
    Tests: 10215, Assertions: 281674, Skipped: 25, Incomplete: 25.

    10k tests, almost 300k assertions

    Dariusz Rumiński
    @keradus
    damn, still 32% users are using 2.0-2.2, 29% users are using 1.x
    guys, what is preventing you from update, and how we could help you to update?
    Andreas Möller
    @localheinz
    How about a tool that helps users convert their configurations?
    Maybe that would help?
    Not sure what the reasons are people don't upgrade.
    SpacePossum
    @SpacePossum
    between 2.x and 2.current no adjustments have to be made to the configuration IIRC, for 1.x to 2.x there is. The upgrading doc states all details about it, but we don't have a tool for it. Making the tool would be awesome, yet a lot of work. I think a lot of people are stuck on 1.x because of integration with other tools which are not updated to use the 2.x line
    Dariusz Rumiński
    @keradus
    that;s the thing, instead of guessing what could be helpful and spending a lot of time to build it, I prefer to first ask what are the issues for users ;)
    Andreas Möller
    @localheinz
    Maybe a quick survey shared via Twitter and elsewhere?
    Dariusz Rumiński
    @keradus
    Hi /all
    this room is obsolete in favor of https://gitter.im/PHP-CS-Fixer
    Muah
    @ctf0
    hi there, is there any option to make sure the “=“ sign have at least one space b4 it ?
    Dariusz Rumiński
    @keradus
    Hi ;) please goto new chat ;)
    this room is obsolete in favor of https://gitter.im/PHP-CS-Fixer
    28development
    @28development
    Hi phpcsfixer does not work on atom anymore, is that a bug? Are there any solutions?
    SpacePossum
    @SpacePossum
    @28development this room is obsolete in favor of https://gitter.im/PHP-CS-Fixer
    please ask there :)
    Dariusz Rumiński
    @keradus
    :heart:
    dotmouse
    @dotmouse

    I need help with this line of code <a class="btn btn-primary" target="_blank" href="https://www.browniepoints.com.au/contact/" id="to_bp">Increase Your Staff Retention</a> I must replace the URL to a different webpage than here...but when I do, testing the button resolves in an error message "The requested URL /contact-us.html/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." PLEASE HELP TO FIGURE OUT WHY THIS HAPPENS

    SpacePossum
    @SpacePossum
    hi @dotmouse this channel is no longer in use, please try here this room is obsolete in favor of https://gitter.im/PHP-CS-Fixer
    ww9
    @ww9

    Anyway to force php-cs-fixer to flatten unnecessary identation?

    Default configuration leaves an entire php file with 2 tabs of identation. Like:

    image.png
    ww9
    @ww9
    I got around it by mass replacing \t\tclass with class. Then running php-cs-fixer.
    I'm sure there must be a good reason forit to not flatten extra idents by default but I can't imagine why.
    Dariusz Rumiński
    @keradus
    hi @ww9 ! there is no good reason for lack of the feature - the technical reason only, currently we have a rule (braces) that is (unfortunately) responsible not only for adding missing braces, but for doing re-indentation inside braces, but not outside it. So here, the "class" statement was not in braces, so it was not de-indented.
    If you want, you can work on bringing this feature!
    Andrejs Stepanovs
    @andrejsstepanovs
    Just had the same issue and found that it is possible to do like so:
    'binary_operator_spaces' => [
        'operators' => [
            '='  => 'align',
            '=>' => 'align',
        ],
    ],