How to attach php documentation in eclipse - php

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

Related

Vscode open classes reference in New tab

You suppose we used some class in current class and now wen I want to open class reference by holding ctrl and pressing left click I expect class reference should be opened in new tab but that show in bottom of class like with below screen shot. However that's not bad but I want to show that in new tab
Please check whether “Preview Mode” is in effect.
For VScode, to stop files from going into preview mode, and always open a new tab go to File -> Preferences -> Settings (or Ctrl + ,)
And try adding the following to “Users Settings”
"workbench.editor.enablePreview": false
Please include a comma if there’s other settings as it has to be a valid json

Readline completion tab extra space

I'm trying to set auto-complete for readline to enable a user to navigate through the filesystem directories when running a script through CLI.
I found out PHP has a function called readline_completion_function for this purpose but every time I hit tab to complete a word, it adds a space at the end.
readline_completion_function(function() {
return ['aaa', 'bbb', 'ccc'];
});
// Input a or b or c
readline('Add char and tab: ');
I've create fiddle for you to test this:
https://repl.it/#rmdev/Readline-Completion-Tab-Extra-Space
I saw on Python readline configs that there's a configuration called set_completer_delims to set a character to be apendend after tab is hit but in PHP there are only two configurations and none of them apply to the completer delims.
I also saw some posts referring to this as a known bug but it seems it has been fixed on most of the integrations although I don't see any reference to a fix for the PHP one.
Is there any way to remove this space?
I'm using PHP 7.2.12 on a Mac.

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).

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.

How to add comments in PHP Eclipse?

How can I add comments in PHP eclipse? I'm trying by selecting few lines of code, then right click, On menu, "Source" and then I have tried all these options there "general element comment", "toggle comment", "Add block comment". None of them works.
PS. I just downloaded latest eclipse PHP version.
Try Ctrl+Shift+/
The question is similair to How to comment a block in Eclipse?
Why don't you just try adding /** + enter? It will produce something like
/**
* Comment here
*/
Remember to follow the doc order
/**
* Description
* #param argument/parameter
* #return
*/
It`s a bug in latest PHP eclipse. Fix is here.
I was using single line comments on my eclipse php project. When i uploaded it to server ,some obfuscation has been applied automatically.Hence all the line breaks are removed and it treating the whole program as a single line. so i am getting an END OF STATEMENT error on server.So its better to use /--/ instead of //---- while commenting.

Categories