Support is and as
[hiphop-php.git] / hphp / hack / test / decl / classes_require.php
blob7449c78458ebe938427d9a8d25c6700de8b0e3f5
1 <?hh
3 abstract class Machine {
4 public function openDoors(): void {}
5 public function closeDoors(): void {}
8 interface Fliers {
9 public function fly(): bool;
12 trait Plane {
13 require extends Machine;
14 require implements Fliers;
16 public function takeOff(): bool {
17 $this->openDoors();
18 $this->closeDoors();
19 return $this->fly();
23 interface HasEngine {
24 public function startEngine(): void;
27 trait Startable {
28 require extends Machine;
29 require implements HasEngine;
31 public function start(): void {
32 $this->closeDoors();
33 $this->startEngine();
37 class AirBus extends Machine implements Fliers, HasEngine {
38 use Plane;
39 use Startable;
41 public function fly(): bool {
42 return true;
45 public function startEngine(): void {}