CodeSniffer not working on PhpStorm/MacOS but it work in Docker - phpstorm

I use PhpStorm 2021.3 on MacOS (Apple Sillicon M1). I'm not sure the problem is with PhpStorm but PHP Code Sniffer doesn't work.
When I type this command it doesn't show any errors in the code and I'm sure I got some.
vendor/bin/phpcs
The only thing that appears in the console is Time: 38ms; Memory: 8MB
CodeSniffer is installed by composer.
On the other hand, if I enter this same command in Docker (with Laravel Sail, in bash), I do get a list of errors/warnings in my code.
Going back to PhpStorm, I tried to configure the IDE to work with PHPCS in Docker, but it still doesn't work, and I don't know where to look.
PHP_CodeSniffer version 3.6.2 (stable) by Squiz
How to make CodeSniffer work, either through PhpStorm or automate it in PhpStorm and Docker?

Related

Why is shadow-cljs returning this error message on "Stale Output"? How to guarantee the watch for this building is running?

I am new to Clojure and not a pro in Javascript. I am watching the free part of the course on Reagent.
Following the instructions on the course's repo, after doing the git clone and the npm install, the author indicates running $ npm run dev. Everything seems to work fine. I can see the app on my http://localhost:3000/.
The favicon with the app's logo and its name is loaded on the corner of the browser's tab:
However, on the bottom of the web page, there is this error message from shadow-cljs:
shadow-cljs - Stale Output! Your loaded JS was not produced by the
running shadow-cljs instance. Is the watch for this build running?
Why is this happening? How should I fix it?
How to guarantee that the watch for this building is running?
Is there a simple command to run on terminal to check this?
Obs. 1: If this is relevant, my operational system is NixOS and this is my config file.
Obs. 2: I am not sure if this question is connected to my previous question on npm and Cider (Emacs IDE for Clojure) that happened while working with this same repo.
It is likely that this is due to you running npm run dev AND cider-jack-in.
I don't use emacs, so I'm not exactly sure what cider-jack-in does, but I believe it launches a new JVM. Since the npm run dev also did that you end up with two running JVMs, which also means two running shadow-cljs instances. That is not ideal and they will start interfering with each other leading to errors such as yours.
So, either you run npm run dev and use emacs to connect to that server. cider-connect or whatever is called should do that.
Or you don't run npm run dev at all and instead only cider-jack-in and then start the watch from the REPL.
Don't forget to first kill all java processes that might be running for that project. As long as there is more than one shadow-cljs process running for the project things will be weird.
This happens to me when I clicked on the build link BEFORE it has compiled. In which case, the link is displaying a previously compiled version, not the live version, and "watch" on code changes doesn't work either. Just wait for your terminal output to say "compiled" before clicking on the link.

PhpStorm is not opening on my Ubuntu 14.04

PhpStorm was running fine till this morning but suddenly it has stopped working. Since the IDE was not loading at all I decided to reinstall it.
The first step was I used the following command to remove the application
$ sudo rm -R ~/Phpstorm*
Then I downloaded version 2016.1 from https://confluence.jetbrains.com/display/PhpStorm/Previous+PhpStorm+Releases and followed the instruction as shown in this article:
https://www.jetbrains.com/help/phpstorm/install-and-set-up-product.html
But neither any launcher icon was created nor I am able to find PhpStorm in application search.
Running $ ./phpstorm.sh in terminal window gives me
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m;
support was removed in 8.0
The above message is familiar to me because it used to come every time I run PhpStorm from terminal.
But after reinstall, the message is appearing but the application does not start.
Edit
Content of /usr/share/applications/phpstorm.desktop
[Desktop Entry]
Version=5.0.4
Name=JetBrains PhpStorm
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=phpstorm
Terminal=false
Icon=/opt/PhpStorm-145.1616.3/bin/webide.png
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
Exec=phpstorm
TargetEnvironment=Unity
Reference article:
https://blog.shaharia.com/create-phpstorm-luncher-and-terminal-command-on-ubuntu

PhpStorm & Xdebug - cant get to work debugger with CLI script

This is my first post here, I post because after reading through X articles googling can't get PhpStorm, Xdebug work with CLI scripts.
Already tried to follow advices from:
PHPStorm + XDebug Setup Walkthrough
https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
PHPStorm + XDebug + Vagrant
and few blogs that I've found online, but still nothing...
I had it working, but after destroy vagrant recently and now can't fully restore this feature.
SETUP:
I'm running Symfony project on Vagrant.
Debugging of "webpages" on my server works just perfectly.
When I try debug CLI Command I prequisite it with:
export XDEBUG_CONFIG="XDEBUG_SESSION=1"
export PHP_IDE_CONFIG="serverName=vagrant"
XDEBUG.INI (on Vagrant):
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=192.168.0.133 (ip I get from ifconfig -a on Vagrant)
xdebug.remote_port=9000
xdebug.max_nesting_level=2500
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM"
Any help much appreciated. Digged through X articles on web but in my eyes all configurations look ok, no idea what to do...
Set xdebug.remote_connect_back to be 0.
This option prevents you from using right IP address when you are doing Remote CLI debugging. Since it's a CLI debug, the IP will always be local (vagrant machine) while you need another one.
This option works OK when debugging over browser as request comes from your "real" computer. But when doing CLI debug .. request will be local to Vagrant machine.
When this option is set to 1 (as it is done now) it ignores the setting from #2 below.
xdebug.remote_host=192.168.0.133 (ip I get from ifconfig -a on Vagrant) -- this should be an IP of your computer where PhpStorm is running as seen from Vagrant machine.
Combination of those 2 above will do the job for you.

HeadlessException when trying to launch/run jProfiler 9 on Fedora 24 Workstation?

I just installed a fresh copy of Fedora 24 Workstation and did a full dnf update on the entire system.
Then I installed the jProfiler rpm from the jProfiler site.
However, when I try to launch jProfiler (either from the /opt/jprofiler9/jProfiler.desktop icon or from /opt/jprofiler9/bin/jprofiler shell script), I get the following error message:
java.awt.HeadlessException
at java.awt.SplashScreen.getSplashScreen(SplashScreen.java:117)
at com.exe4j.runtime.splash.AwtSplashScreen.<init>(AwtSplashScreen.java:17)
at com.exe4j.runtime.splash.SplashEngine.setJavaSplashScreenConfig(SplashEngine.java:17)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:50)
I've tried setting my display using DISPLAY=0.0 or even DISPLAY=:0, but neither seem to make any difference/impact.
Any suggestions how to get this to work? I suspect it is something obvious that I am overlooking.
After a bunch of trial and error, I finally tried to install the Oracle Hotspot JRE instead of the OpenJDK JRE. I downloaded Oracle's JDK, installed it, and then configured it as the system default using:
sudo alternatives --config java
Now everything works properly with Oracle JRE.

Using synce-install-cab in fedora to install cab file

I have Fedora 20 and want to install a .cab file. I found the proper way to do this is with synce (http://linuxmanpages.net/manpages/fedora21/man1/synce-install-cab.1.html). However when I type:
synce-install-cab - install .cab data.cab
or
synce-install-cab - install data.cab
I get the following message:
Enter .cab file as parameter
How can I install my cab file properly?
Thanks in advance.
Okay, so, two things.
First, are you sure this is the command you want? This command is for installing software in .cab files to Windows CE devices. If you don't have that, maybe you want cabextract (although that won't, of course, make Windows software actually run on Fedora).
Second... I don't know this actual command (as I don't have a a Windows CE device), but, from the man page you linked, there's no reason to run synce-install-cab - install .cab data.cab — that's not instructions, it's just the summary at the top of the file. The actual command seems simply to be
synce-install-cab data.cab