vysker / vscode-php-formatter

Visual Studio Code extension. A wrapper for the Sensiolabs PHP CS Fixer. Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible).
MIT License
92 stars 11 forks source link

Neither a pharPath or use of Composer was specified. Aborting... #17

Open stereoit opened 7 years ago

stereoit commented 7 years ago

In visual studio code I've started to get the message in subject every time I save the PHP file. I working on older project with symfony 1.4.

weiliank commented 7 years ago

Facing same issue +1

hampusboas commented 7 years ago

+1

uMotif-wichura commented 7 years ago

+1

nofendian17 commented 7 years ago

+1

spencerchang commented 7 years ago

+1

jhoneswilliam commented 7 years ago

-1 using

prantikv commented 7 years ago

any update on this?

cjonasw commented 7 years ago

+1

roberteventival commented 7 years ago

I just would like to state I am using latest VSCode + php-cs-fixer 0.1.34 and PHP formatter 0.2.4. Whenever I paste any PHP text, I get the message in the topic. When I have only php-cs-fixer enabled nothing happens (basically I start to get this when I enable php-formatter extension). I am extending old symfony 1.4 project (if that helps).

ghost commented 7 years ago

+1

nosdoska commented 7 years ago

+1

tboydar commented 7 years ago

+1 . mac vscode

Jakobud commented 7 years ago

+1. Doesn't work at all. A plugin should not require you to install outside dependencies. If you can't automatically install all dependencies via npm then fail.

shahsagarm commented 7 years ago

+1

stereoit commented 7 years ago

Is there anything I can do to resolve this? Somehow turn some setting on, provide logs?

On Thu, May 4, 2017 at 9:01 AM, Sagar Shah notifications@github.com wrote:

+1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dickurt/vscode-php-formatter/issues/17#issuecomment-299110705, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEDnCe9zggPknl5U2xl61U1GguyFsVuks5r2Xe0gaJpZM4MmY1g .

-- stereoIT s.r.o. Heřmanova 23 107 00 Praha 7 mob: +420 776 76 23 78

lepiou commented 7 years ago

+1 :/

shahidmau commented 7 years ago

+1

ronbuchanan commented 7 years ago

+1

kevin-valerio commented 7 years ago

+1

sferrka commented 7 years ago

+1

leocarmo commented 7 years ago

+1

rarslan commented 7 years ago

+1

rarslan commented 7 years ago

Is there any solution for this?

spencerchang commented 7 years ago

Hi everyone, i found out when added the setting "phpformatter.composer": true, "phpformatter.arguments":["--rules=@PSR2"] This issue could be solved. If you didn't use composer installed, must to point the "phpformatter.pharPath" path.

Try it! Thanks.

rarslan commented 7 years ago

Didn't work for me...

LiHRaM commented 7 years ago

Had the same problem, but I already had composer installed, so all I had to do was change the composer settings to true, and the problem went away.

"phpFormatter.composer": true

heinzin commented 7 years ago

It's work on Linux OS with
into settings.json

// Should point to php-cs-fixer.phar file, if you have installed this manually (without Composer). Should include .phar extension.
"phpformatter.pharPath": "/home/user/.config/composer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer.phar",

// If the pharPath is set, and you are not using Composer, and you haven't added PHP to your PATH, this should point to the php.exe file.
"phpformatter.phpPath": "php",

// Whether the php-cs-fixer library has been installed using Composer. If true, the extension will override pharPath and assume you have added Composer to your PATH.
"phpformatter.composer": false,

// Add arguments to the executed fix command, like so: ['--level=psr2', '--fixers=linefeed,short_tag,indentation'].
"phpformatter.arguments": [
    "--level=psr2"
],

// If true, the extension will log all sorts of (debug) info to the console. Useful for troubleshooting.
"phpformatter.logging": true,

// If true, the extension will show notifications.
"phpformatter.notifications": true
stereoit commented 7 years ago

Hi,

the solution for me:

a) uninstall php-cs-fixer from VSCode b) install php-cs-fixer via composer: composer global require friendsofphp/php-cs-fixer c) modify setting (ctrl,) add ""phpformatter.composer": true

Then I do not receive any of those error messages.

On Fri, May 26, 2017 at 9:10 AM, Hein Zin notifications@github.com wrote:

It's work on Linux OS with into settings.json

// Should point to php-cs-fixer.phar file, if you have installed this manually (without Composer). Should include .phar extension. "phpformatter.pharPath": "/home/user/.config/composer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer.phar",

// If the pharPath is set, and you are not using Composer, and you haven't added PHP to your PATH, this should point to the php.exe file. "phpformatter.phpPath": "php",

// Whether the php-cs-fixer library has been installed using Composer. If true, the extension will override pharPath and assume you have added Composer to your PATH. "phpformatter.composer": false,

// Add arguments to the executed fix command, like so: ['--level=psr2', '--fixers=linefeed,short_tag,indentation']. "phpformatter.arguments": [ "--level=psr2" ],

// If true, the extension will log all sorts of (debug) info to the console. Useful for troubleshooting. "phpformatter.logging": true,

// If true, the extension will show notifications. "phpformatter.notifications": true

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dickurt/vscode-php-formatter/issues/17#issuecomment-304209749, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEDnE-xVaEJvT6Viz9Z0GIuS0VQ6QRLks5r9nr-gaJpZM4MmY1g .

-- stereoIT s.r.o. Heřmanova 23 107 00 Praha 7 mob: +420 776 76 23 78

rdaruich commented 7 years ago

+1

vlaim commented 7 years ago

+1

DannyFeliz commented 7 years ago

+1

lloricode commented 7 years ago

+1

jpacareu commented 7 years ago

+1

rafappelt commented 7 years ago

+1

lloricode commented 7 years ago

still? +1

jpacareu commented 7 years ago

Guys ... Not the solution but Brackets is quite good, if you install a couple of plugins in it you would have a nice IDE

Daky commented 7 years ago

My case. After uninstall PHP Formatter(Sophisticode.php-formatter), the message did not show again.

teknotica commented 7 years ago

+1

JeremyOB commented 7 years ago

+1

david-portilla commented 7 years ago

+1

jikkujose commented 7 years ago

The message went away but I don't see any formatting! Should I do something other than right click format document?

xxjapp commented 7 years ago

did nothing

WagnerSilveira commented 6 years ago

+1

flegfleg commented 6 years ago

+1

alxvallejo commented 6 years ago

@all instead of saying +1, you should report on whether the solutions are working or not. @stereoit worked for me

MikeyBeLike commented 6 years ago

@stereoit solution for me worked too. What I did:

a) Install cs fixer globally composer global require friendsofphp/php-cs-fixer b) add composer binaries to path (if you haven't already) export PATH="$PATH:$HOME/.composer/vendor/bin" - for unix systems, similar for windows c) you can confirm cs fixer is added to path by simply entering php-cs-fixer in your terminal d) in vscode update your settings to use the composer installed version "phpformatter.composer": true

haydentech commented 6 years ago

Words cannot express how lame it is this has not been fixed by the developer after 6+ months. I've tried the various steps above. Now it just silently fails instead of showing the message given in the bug report.

MikeyBeLike commented 6 years ago

@haydentech there's nothing to fix that's why, people don't follow simple instructions. See here: https://github.com/Dickurt/vscode-php-formatter/wiki/Prerequisites

haydentech commented 6 years ago

@Lyricalz I've followed those instructions. That got me from "Not working, and gives me an error message" to "Not working, but gives no message whatsoever". php-cs-fixer is installed via composer, is on my path, and I have made the necessary change in the Code settings. I'm on Ubuntu 16.04 and Code 1.18.0 if that matters.

zeybek commented 6 years ago

Trash extension... Gulp is a better choice