A
A
AndreyTM2015-03-17 15:37:04
PHP
AndreyTM, 2015-03-17 15:37:04

How to write correct code (PHP) from IDE point of view?

In general, I write my small CMS in PHP. As an IDE, I use NetBeans 8. I ran into such a problem as understanding the work of my code in the IDE itself.
For example, unlike php in java, everything is laid out "on the shelves" - the classes are in packages, there are import statements that indicate where this or that class comes from - everything is extremely clear.
In php, you have to think about loading classes, with specifying data types for variables using special comments (so that the IDE understands), there are all sorts of include files. Due to such wide possibilities of the IDE, it is difficult to understand the work when (where this or that variable, class, etc. comes from), which is why it is not able to see half of the errors, and the code reorganization tool also does not work correctly (not all changes). Because of all this, I am not comfortable working with PHP.
I would like to hear recommendations about writing the "correct" code from the point of view of the IDE, the list of errors should not be done.
ps Perhaps the wording of the question is not entirely correct.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
FanatPHP, 2015-03-17
@FanatPHP

www.php-fig.org/psr/psr-4/ru
blog.jetbrains.com/phpstorm/2014/04/psr-0-psr-4-an...

S
Sharov Dmitry, 2015-03-17
@vlom88

unlike php in java, everything is laid out "on the shelves" - the classes are in packages

We use namespacestyts
From there same as namespaces

I
index0h, 2015-03-17
@index0h

* PSR-0 - PSR-5 (last one not adopted yet)
* Don't use magic
* Don't use arrays [string => anyType]
* Don't write in mixed doc blocks, or don't use object
* eval, meaning never
* hard-type arguments (in dock blocks AND check them at the beginning)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question