facebook / facebook/hhvm

Add quickfix for missing parent::__construct()

Open
#8,971 0 comments 0 reactions 0 assignees View on GitHub
major-league-hacking
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

Example bad code:

```hack
class MyParent {
public function __construct() {}
}

class MyChild extends MyParent {
public function __construct() {
foo();
}
}
```

The quickfix should add the call at the beginning of the method.

```hack
class MyParent {
public function __construct() {}
}

class MyChild extends MyParent {
public function __construct() {
parent::__construct();
foo();
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.