mirror of
https://github.com/danog/psalm.git
synced 2024-12-03 18:17:55 +01:00
13 lines
287 B
Markdown
13 lines
287 B
Markdown
|
# DirectConstructorCall
|
||
|
|
||
|
Emitted when `__construct()` is called directly as a method. Constructors are supposed to be called implicitely, as a result of `new ClassName` statement.
|
||
|
|
||
|
```php
|
||
|
<?php
|
||
|
class A {
|
||
|
public function __construct() {}
|
||
|
}
|
||
|
$a = new A;
|
||
|
$a->__construct(); // wrong
|
||
|
```
|