php-ide

Variable type hinting in Netbeans (PHP)

≯℡__Kan透↙ 提交于 2019-12-17 07:01:40
问题 Just curious if there's a way in netbeans to give type hints for regular variables, so that intellisense picks it up. I know you can do it for class properties, function parameters, return types, etc. but I can't figure out how to do it for regular variables. It's something that would really help in situations where you have a method that can return different object types (like a service locator). ex something like: /** * @var Some_Service $someService */ $someService = ServiceLocator::locate

PHPDoc and late (static or dynamic) binding

走远了吗. 提交于 2019-12-05 13:56:59
问题 Most PHP IDEs rely on phpdoc to get hints about the type of an expression. Yet, I use frequently this pattern, which doesn't seem to be covered: class Control { private $label = ''; /** @return ??? */ public static function Make(){ return new static(); } /** @return ??? */ public function WithLabel($value){ $this->label = $value; return $this; } /** @return void */ public function Render(){ /* ... */ } } class Textbox extends Control { private $text = ''; /** @return ??? */ public function

How to stop this inspection: “Member has protected access, but class has magic method __get”?

孤人 提交于 2019-12-05 10:19:29
How to stop this inspection: "Member has protected access, but class has magic method __get"? I searched everywhere but can not find the option to disable this inspection. I really do not want the properties remain marked with a different color when they are private and there is a magic method __get in classes. Wrong answer here. As @LazyOne mentioned the solution is: @property string $File in php doc. To remove the mark should do the following: Settings (CTRL + Alt + S) Editor -> Colors & Fonts -> Copy the current Scheme Editor -> Colors & Fonts -> General -> Erros and Warnings -> Warning

PHPDoc and late (static or dynamic) binding

孤人 提交于 2019-12-03 23:26:19
Most PHP IDEs rely on phpdoc to get hints about the type of an expression. Yet, I use frequently this pattern, which doesn't seem to be covered: class Control { private $label = ''; /** @return ??? */ public static function Make(){ return new static(); } /** @return ??? */ public function WithLabel($value){ $this->label = $value; return $this; } /** @return void */ public function Render(){ /* ... */ } } class Textbox extends Control { private $text = ''; /** @return ??? */ public function WithText($text){ $this->width = $text; return $this; } } Now I can use the classes like this: Textbox:

How to install a PHP IDE plugin for Eclipse directly from the Eclipse environment?

妖精的绣舞 提交于 2019-11-28 15:48:44
问题 I have a clean Eclipse Java SDK. I would like to make it suitable for developing PHP applications. So I need a PHP IDE plugin (or something like that). How could I install it from the Eclipse environment? 回答1: Easy as pie: Open Eclipse and go to Help-> Software Updates-> Find and Install Select "Search for new features to install" and click "Next" Create a New Remote Site with the following details: Name: PDT URL: http://download.eclipse.org/tools/pdt/updates/4.0.1 Get the latest above

Variable type hinting in Netbeans (PHP)

与世无争的帅哥 提交于 2019-11-27 02:47:59
Just curious if there's a way in netbeans to give type hints for regular variables, so that intellisense picks it up. I know you can do it for class properties, function parameters, return types, etc. but I can't figure out how to do it for regular variables. It's something that would really help in situations where you have a method that can return different object types (like a service locator). ex something like: /** * @var Some_Service $someService */ $someService = ServiceLocator::locate('someService'); Where using $someService afterward, netbeans would provide all available methods