Code Monkey home page Code Monkey logo

Comments (11)

mathieutu avatar mathieutu commented on May 17, 2024 3

An other example here. I think it can be related to this issue:

    {
-        return str_replace_array('#', [
-            $this->budget->name,
-            $this->requester->name,
-            'justif',
-        ], '# - # - #');
+        return str_replace_array(
+            '#',
+            [$this->budget->name, $this->requester->name, 'justif'],
+            '# - # - #'
+        );
     }

from plugin-php.

czosel avatar czosel commented on May 17, 2024 1

Alright, no worries 🙂 If you change your mind, i'd recomment to take a look here and otherwise you can also always ask me!

from plugin-php.

czosel avatar czosel commented on May 17, 2024 1

@mgrip i also tried to implement this in #123 based on the JS implementation, but i didn't arrive at a proper solution yet. You might want to take a look 😄

from plugin-php.

MichaelDeBoey avatar MichaelDeBoey commented on May 17, 2024

So the example in #23:

$this->something->method($argument, $this->more->stuff($this->even->more->things->complicatedMethod()));

Should become

$this->something->method($argument, $this->more->stuff(
  $this->even->more->things->complicatedMethod()
));

I think 🙂

from plugin-php.

czosel avatar czosel commented on May 17, 2024

@MichaelDeBoey yes, i think so too! Do you want to give this a shot? 😉

from plugin-php.

MichaelDeBoey avatar MichaelDeBoey commented on May 17, 2024

@czosel I'm not really into the codebase 😕

I'm just here because I'd like to use prettier for both my front- and backend in a Laravel project actually... 🙂

from plugin-php.

mgrip avatar mgrip commented on May 17, 2024

So I started looking into this but some of the examples outline above get pretty tricky. For reference, this is how prettier (js) handles it

https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBDADugdAczjACgHIiAaAAgIBIpUBbOASnIF4A+c4cgJ3wFduUckQAScADbiIwgNzkAvoxkAdKKozY8hEhWq0Gzdpx79BwsZOlE58ikXgBnGESWr1mXPmK9UkgJ4+-oHiAXC+IcF+UlA4ZJQ09EysHFy8MAJCohJSsgquarQeWgSOMBQA2vZwTnFVNXaltY0N1c4t9cLNna1NPQC6+e6aXqUVdW3dHeO9U13T7RPzk859FKWDhcOEo+SVc-s9CzOLB7OHy8dEq+TrMiCkIBDoMACW0A7IoKjc3BAA7gAFb4ID4oVAANwgLwAJvc0E5kAAzXwOOAPABG3FQYAA1vgAMrobEvGLIGDcPhokDQiBgJEoqkk1HcGAArE4OioeniVEPABWDgAHgAhLG4gmJAAyJLg3N5jz4MHQioATHKqUTuMzkCB0ah0VFoHD0NwSTAAOowmAAC2QAA4AAwPE0QVHmrHoHUm6pwbjg2UPXgARz4L14bNQHK5SGRPKpqLoLzJFPjJJw4jgAEU+BB4OqHjB9ZboTbkCqC1iXuI0wBhCB0Tk6qDQAMgPiogAq+tBsdR8nkQA

from plugin-php.

mathieutu avatar mathieutu commented on May 17, 2024

So, for me, your examples are:

Do you confirm?

from plugin-php.

mgrip avatar mgrip commented on May 17, 2024

Ahhh I was wondering if we would have to use that conditionalGroup - the docs say to use it as a last resort which scared me off haha

from plugin-php.

mgrip avatar mgrip commented on May 17, 2024

@mathieutu yes I agree - I'm wondering if its actually going to be possible to pretty-print in the way that PSR12 is dictating. Wanted to just give examples of how prettier-js does it for reference

from plugin-php.

czosel avatar czosel commented on May 17, 2024

Most of the examples listed in this issue should be fixed by #123 - let's open new issues for anything that might be missing.

from plugin-php.

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.