I am using sublimetext3 unregistered . I want to know how can I configure sublime to show unused and undefined variables in php .sublimelinter-phplint does some useful work but it cannot recognise autoloaded classes that can be very irritating while development .I am looking for some package that can do it with file scope.
I have following packages already installed
sublimelinter
phpcs
3.sublime-phpcs
Is there anyother package that can be userful in developement ?
http://phpmd.org will show unused code. there is a SublimeLinter-phpmd extension as well. Just install both SublimeLinter and this extension, open the User preferences for SublimeLinter, and reduce the phpmd rulesets to just "rulesets": "unusedcode" to avoid over reporting on conventions and such you might not use.
SublimeLinter works quite well but for php I use an extension :
https://github.com/SublimeLinter/SublimeLinter-php
You need SublimeLinter 3 for this : http://sublimelinter.readthedocs.org/en/latest/installation.html
Which i see you already have! ^^
Appart from that.. Another IDE ? ^^
A Note about another editor which has a LOT of tools.. ATOM
Related
PhpStorm does not recognize PHP built in functions like count(), urldecode(), str_replace() etc. So many annoying warnings shows on each file & auto_complete does not work.
PhpStorm v2020.3
I've tried Invalidate caches / restart, deleting PhpStorm cache folder and also disabled all 3rd party plugins. But this problem exists yet.
Any suggestion would be appreciated.
I found the reason. PhpStorm Php interpreter did not set correctly. After set interpreter and delete manually "caches" & "index" folders and restart Phpstorm it fixed successfully!
C:\Users{my_user}\AppData\Local\JetBrains\PhpStorm2020.3\caches
C:\Users{my_user}\AppData\Local\JetBrains\PhpStorm2020.3\index
I want to setup my development environment using vscode. However, I am confused on that would be the difference between intelephense and phpcs. I have the code in Github from my company and it has the .phpcs.xml.dist. I believe this file is for phpcs. It works already but I missed the intelephense code formatting and autocomplete feature. Can someone help in elaborate more on the difference between these 2 and do they conflicting each other should I installed both of them in my vscode.
TIA
Hery
Intelephens have lots of feature, but most people use it for auto format code file.
Intelephens uses PSR12 as default standard Sortcut Key [Shit + Alt+ F] it also format HTML, Css, Js. It detect PHP version from your Host envirment and show you code warnings and systex error.
If your Dev team use PHPCS then you may need to use PHPCS vscode extension.
Not sure about Intelephens can detect .phpcs.xml.dist from your project. Your team may have CICD Pipline to check code stadarad (via phpcs) and fix them (via phpcsf)
or reject PR via Bot!
Both are the best way to reduce None standard code.
if you are using opensource then use styleci it's free for public repository.
I'm using XAMPP with PHP 7.3 with Phalcon 3.4 extension in Windows 10.
I've been having issues on getting code suggestion, or even errors because VS Code can't seem to find Phalcon files.
I've been seeing PhpStorm tutorials and then just including Phalcon Dev Tool in the include path.
Extra Notes: I am using Inteliphense, but I'm willing to use Intelisense from Felix Becker
Do VS Code have this? How do I fix this issue?
You can also install the following package or VSCode :
composer require phalcon/ide-stubs --dev
If you use PHP IntelliSense from Felix Becker - you need to add all the Phalcon Stubs to language server stubs cache inside felixbecker/intellisense plugin. Or, you can use your own language server, but it not easy way to have autocompletion into VSCode...
Been using eclipse for a short while. I run ubuntu 10.10 and have installed Eclipse web tools platform plug-ins for ecplise and the php development tools plug-in, when I started a php project I also installed the php perspective, but this doesn't work when I run php files?!
I get this error
Unsupported content type in editor
So when I edit php files I use the Java perspective. This works. I can't say that eclipse impress much with all these weird errors when I install every thing by default and are only doing simple tasks, like editing a php file with a php editor..
I also get this error when I open .tpl files (smarty template engine files)
Could not open the editor: The editor
class could not be instantiated. This
usually indicates a missing no-arg
constructor or that the editor's class
name was mistyped in plugin.xml.
Thats my main problem.
I had the same error namely: Unsupported content type in editor
And solved it this way: You need to open it in navigator (window -> show view -> navigator) not the php perspective or project view or anything else.
At least this worked for me hope it also helps you!
After doing the file association,You need go to preference general > content type > Text and add extension For example , I need *.tpl to be open in HTML editor, than I can do like below.
This seems to be related to your JRE installation.
See those two forum threads:
http://forum.gentleware.com/viewtopic.php?t=4113
http://www.anddev.org/eclipse_fails_to_load_editors_sometimes-t3156.html
Quote:
Reasons could be manifold.
Most popular: You're running Apollo
for Eclipse with JRE version < 1.5.
Look for a line saying
java.vm.version=xxx in Help->About
Eclipse SDK->Configuration Details
We are currently using Aptana for PHP and Eclipse for Java. While Aptana is built on Ecplise, it treats PHP files differently when they won't parse/compile. I'd love to use Eclipse for both, but I can't figure out how to suppress errors that should be ignored.
We use simpletest for all of our projects so we have it included in our "core" project and check it into SVN. Simpletest includes "test_with_parse_error.php", which is an invalid php file. In Aptana, the project does not show as having an error (nor does any php file) until you open it. At that point, you can see that the file has an error, but the project as a whole doesn't change (there is no "red X" on the directories where the file is located).
It almost appears as if Aptana treats folders as regular folders while Eclipse (galileo) treats all folders in a PHP project as "source folders". Is there a way to specify which folders should be considered "source" and which should not when looking for errors?
starting with eclipse PDT 2.0, you can exclude resources from the build process using the PHP Build Path configuration. this will also suppress warnings from the invalid file.
If Aptana is build on Eclipse, couldn't you just configure it to show the Java view? I could configure my Zend studio (also built on Eclipse and very much like Aptana) to show the Java view/workspace and work with it..