PhpStorm and expanded php definitions - php

Using code hinting, PHPStorm can show me quick function definitions; can it be configured to show me more detailed examples of the function's use?

You can place the cursor (text-cursor, not mouse-cursor) on any PHP function and press Shift + F1 (Menu: View -> External Documentation).
That will open the detailed description incl. examples and user-comments (read: the PHP manual).

With an OSX specific keyboard, you may need to trigger the F1 key by pressing fn + F1. So here are two use cases that work for me:
Open php.net documentation: fn + shift + F1
Quick view php.net documentation: fn + F1
You may also find it useful that you can enable Quick documentation on hover. Open up File > Preferences, navigate to the Editor section, and at the bottom check the box for Show quick doc on mouse move.

Related

Disable Undefined Property error in PHP Devsense extension on VSCode

I just added the PHP extension by Devsense to my VSCode and now it's lighting up like a Christmas tree. I want to disable the Intellisense option for unknown/undefined properties.
Here is the issue
and the error message
Undefined property: MY_Model::$load PHP(PHP0416)
And a link to the post where they talk about adding it
I saw some options for Intelliphense where you could set "intelephense.diagnostics.undefinedProperties": false
in the vscode settings.json, but I couldn't find anything that would work for this extension.
The fix described here in the 3rd post to add the property in a comment does work, but is not feasible in the codebases I am working in. I need something more like the second post, where I can just disable the check altogether
I found the answer to my own question. Leaving it here because It took me way too long.
You just have to exclude the error code, in this case error code 0416
1 - Open Settings.json : ctrl + shift + P and type 'settings.json'
2 - Select 'Open User Settings (JSON)
3 - At the end of file, add this code:
"php.problems.exclude" : {
"/" : [416],
"vendor/" : true,
}

PhpStorm and expanded php method definitions on same project

Using code navigation, PHPStorm can not show me quick function definitions; can it be configured to show me more detailed examples of the function's use? I have used ALT + F7 but its not helping.
as from this question
You can place the cursor (text-cursor, not mouse-cursor) on any PHP function and press Shift + F1 (Menu: View -> External Documentation).
That will open the detailed description incl. examples and user-comments (read: the PHP manual).

How to attach php documentation in eclipse

Is there any way to attach PHP docs in eclipse, so that if I hover over any function I could get all the details and the related description.
Something on similar lines to javadocs.
Using:
Eclipse: helios
php5.
OS: Ubuntu 12.04
Here is step for configure PhpDoc into eclipse :
1. Open eclipse IDE
2. Then select Window Menu & Select Preferences
3. Then navigate through php menual
4. After Cliking on New You will get this Window :
Here specify latest .chm File Give Name and Press Ok.
5. Set it to default & press Ok [ It will display in bold letter]
6. After Setting it to default you will get your local help will highlighted with bold letter
7. When you want to see doc for php function then press Shift + F2
Note : You can also change help option from Window -> Preferences
You can try:
Create a new PHP Project (File->New->PHP Project)
Switch to the PHP perspective (Window->Open Perspective->PHP)
Create a PHP file
If you now write something like
<?php phpinfo(); ?>
and hold your mouse over "phpinfo" you should get a popup with the information.
Hold CTRL to jump directly into it.
If you want to documentate your own code use the following:
/**
* Some text here
* #param string $str input
* #param array $arr data
* #return boolean
*/
hope that will help you.
Cheers

In Vim + Eclim, How to open "SearchContext" in vertical window

I'm using Eclim, in doc Suggested Vim Mappings , I know a mapping for PHP
nnoremap <silent> <buffer> <cr> :PhpSearchContext<cr>
but it opens a horizontal window, how to change it to a vertical window?
Just like diff between :help and :vert bo help
Place in your .vimrc the following:
let g:EclimDefaultFileOpenAction = 'vsplit'
Or, you can add such settings for PHP only:
let g:EclimPhpSearchSingleResult = 'vsplit'
Unfortunately, such value 'vsplit' is not stated in the Eclim's documentation, I just remember the same question in the eclim-user mailing list.

any open source IDE with the possibility to go the declaration of a function, a variable..?

any open source IDE with the possibility to go the declaration of a function, a variable, a class... presing a key(s)??
Apart from Netbeans and Eclipse.
Regards
Javi
Take a look at ctags, and e.g. vim. In reality, "ctags" is a gross understatement, as you can generate an index of function and variable "tags" for almost any language.
emacs or vim would allow you to do this for most languages. Not really an IDE though.
I prefer to use PHPDesigner which does have a free edition. What you appear to be asking about is called "code completition" which this editor does, along with the ability to right click a custom function and "Go to definition" or hit F1 to view the PHP Manual on that function.
May be Komodo edit ? It's close to Eclipse and Netbeans, but much more simpler. You can go to declaration of function or variable by a custom shortcut key or just CTRL + Click on the desired var/func.

Categories