ezsystems/ezpublish-legacy — pull request #789 by jeromegamez (2013-10-14 14:55:50+00:00)
Title: Constructor refactoring (PHP4 to PHP5 __construct())

Due to eZ Publish's history, most of the classes use PHP4 style constructors in the form

```php
class MyClass
{
function MyClass()
{
// Constructor
$this->MyParentClass();
// More code
}
}
```
instead of
```php
class MyClass
{
function __construct()
{
// Constructor
parent::__construct();
// More code
}
}
```

In our modern times, this is problematic due to the following reasons:
- If you want to use the parent's constructor, you have to call it explicitely
- Derived classes call the parent constructor by its name instead of `parent::__construct()` which makes the refactoring of class names cumbersome
- We don't know if and when a future version of PHP will stop supporting the PHP4 constructor methods
- It's not PHP5 style

This pull request changes this by doing the following:
- Replace every PHP4 style constructor with the PHP5 style `public function __construct()`
- Replace every call to the parent's constructor with `parent::__construct()`
- Delete all empty constructors
- Delete all constructors that just call the parent constructor
- For the more "popular" classes that are most likely to be used in 3rd party extensions, the new constructor is just added, and the old style constructor is marked as deprecated
- Replace every other direct call of the old style constructor

If you think more classes should keep the old style constructor (marked as deprecated) in addition to the new one, please let me know.

Cheers
:octocat: Jérôme