Skip to content

After running PHP CS Fixer, the file content has not changed, #25

Closed
@ywdblog

Description

@ywdblog

hello:

my question

(1) my PHP CS Fixer ,version is "PHP CS Fixer 2.2.1 by Fabien Potencier and Dariusz Ruminski"

(2) my php ide is 8.1/windows 10

(3)plugin is 5.3,https://github.com/junichi11/netbeans-php-cs-fixer-plugin/releases/tag/v0.5.3

and last,After running PHP CS Fixer, the file content has not changed,includeing output is empty。

thanks,

1

2
3

Activity

junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

Please try to use NetBeans8.2 with v0.6.0[1]. It provides support for PHP-CS-Fixer 2.x.

[1] https://github.com/junichi11/netbeans-php-cs-fixer-plugin/releases/tag/v0.6.0

Thanks.

ywdblog

ywdblog commented on Apr 20, 2017

@ywdblog
Author

@junichi11 Thanks.

I did what you said, but it was the same as last time.
Attachments are shown below
qq 20170420104234

junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

Can you run it in command line?

ywdblog

ywdblog commented on Apr 20, 2017

@ywdblog
Author

it's ok.

C:\Users\ywdblog\AppData\Roaming\Composer\vendor\bin>php-cs-fixer fix ./test.php
Loaded config default.
Using cache file ".php_cs.cache".

junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

OK. Please attach your IDE log.

ywdblog

ywdblog commented on Apr 20, 2017

@ywdblog
Author

Is this one?
thanks

qq 20170420104234

junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

No. Look at Menu bar > View > IDE log.

ywdblog

ywdblog commented on Apr 20, 2017

@ywdblog
Author

ok:

SEVERE [org.openide.util.Exceptions]
java.io.IOException: CreateProcess error=193, %1 不是有效的 Win32 应用程序。
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "C:\Users\ywdblog\AppData\Roaming\Composer\vendor\bin\php-cs-fixer" (in directory "C:\xampp\htdocs\rss"): CreateProcess error=193, %1 不是有效的 Win32 应用程序。
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.netbeans.modules.extexecution.base.ExternalProcessBuilder.call(ExternalProcessBuilder.java:295)
at org.netbeans.api.extexecution.base.ProcessBuilder$LocalProcessBuilder.createProcess(ProcessBuilder.java:324)
at org.netbeans.api.extexecution.base.ProcessBuilder.call(ProcessBuilder.java:275)
at org.netbeans.api.extexecution.base.ProcessBuilder.call(ProcessBuilder.java:94)
[catch] at org.netbeans.api.extexecution.base.BaseExecutionService$2.call(BaseExecutionService.java:222)
at org.netbeans.api.extexecution.base.BaseExecutionService$2.call(BaseExecutionService.java:198)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Caused: java.util.concurrent.ExecutionException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.netbeans.api.extexecution.ExecutionService$7.get(ExecutionService.java:290)
at org.netbeans.api.extexecution.ExecutionService$7.get(ExecutionService.java:251)
[catch] at org.netbeans.modules.php.phpcsfixer.ui.actions.FixAction.runCommand(FixAction.java:94)
at org.netbeans.modules.php.phpcsfixer.ui.actions.PhpCsFixerBaseAction.actionPerformed(PhpCsFixerBaseAction.java:84)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:751)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:702)
at java.awt.EventQueue$3.run(EventQueue.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:724)
at java.awt.EventQueue$4.run(EventQueue.java:722)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:721)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

Thanks!

Now, I cannot reproduce it in my environment:
Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_121; Java HotSpot(TM) 64-Bit Server VM 25.121-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_121-b13
System: Linux version 4.4.0-72-generic running on amd64; UTF-8;

I'll try it in Windows later when I can make time.

Please try the following:

  • Use a phar file
  • Check the permission of php-cs-fixer
  • Check the path for php interpreter (Options > PHP > General)
ywdblog

ywdblog commented on Apr 20, 2017

@ywdblog
Author

Using the phar mode is OK, thanks ~~~

and one question:

print       "hehe";

Multiple spaces (behind the print statements) can be fixed as one?
fixer :

print "hehe";
junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

Using the phar mode is OK, thanks ~~~

Great to hear :)

and one question:
print "hehe";
Multiple spaces (behind the print statements) can be fixed as one?

If it means about features of PHP-CS-Fixer itself, please ask it in a proper place(e.g. stackoverflow, e.t.c.) because I'm not sure.

Thanks.

ywdblog

ywdblog commented on Apr 20, 2017

@ywdblog
Author

@junichi11 非常感谢~ Thanks.

junichi11

junichi11 commented on Apr 20, 2017

@junichi11
Owner

You are welcome :)

junichi11

junichi11 commented on Jul 3, 2017

@junichi11
Owner

Once I close this issue. If someone has the same problem, I'll look at it again. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ywdblog@junichi11

        Issue actions

          After running PHP CS Fixer, the file content has not changed, · Issue #25 · junichi11/netbeans-php-cs-fixer-plugin