Not a PHP developer?
Although Insphpect is aimed at PHP projects, the suggestions it gives are all aimed at Object-Oriented Programming bad practices in relation to flexibility.
The background research was entirely language agnostic.
As the research isn't focused on PHP, getting feedback solely from PHP developers may skew the results towards the opinions of PHP developers. As such, we're asking non-php developers to look through some of the reports and provide feedback even though some of the code may be a little unfamiliar.
If you write Object-Oriented code in Java or Python, PHP's concepts are identical, the only thing that might look at little strange is the syntax.
If you don't have a background in PHP you can still read through the code. PHP's object model is very similar to Java. There's only a few things you need to know to read the PHP code:
- Constructors are defined using a function called __construct() in the class, rather than the name of the class.
- PHP variable start with a dollar sign
- To access class variables you must prefix them with the $this operator even if there is no local variable with the same name
- To access a property or call a method on an instance PHP uses the arrow -> operator like C++.
- Type hinting is optional. Depending on the library author they may or may not have included it (Generally, modern projects include this as a matter of course)
- Static properties and methods are accessed using a double colon :: rather than a dot.
So even if you don't have a background in PHP but do write Object Oriented code in another language, take a look through some of the sample reports below and let us know what you think!
Remember, this project is about programming practices, not what the individual libraries being analysed are doing. It doesn't matter if you understand every line of code as long as you can spot the familiar OOP practices!
Choose one of the projects below to view sample reports: