| 1 | <?php  | 
            ||
| 7 | class ProcessWorker  | 
            ||
| 8 | { | 
            ||
| 9 | /**  | 
            ||
| 10 | * @var int  | 
            ||
| 11 | */  | 
            ||
| 12 | protected $interval;  | 
            ||
| 13 | |||
| 14 | /**  | 
            ||
| 15 | * @var ProcessInterface  | 
            ||
| 16 | */  | 
            ||
| 17 | public $process;  | 
            ||
| 18 | |||
| 19 | /**  | 
            ||
| 20 | * ProcessWorker constructor.  | 
            ||
| 21 | *  | 
            ||
| 22 | * @param string $process  | 
            ||
| 23 | * @param OutputInterface $output  | 
            ||
| 24 | * @param int $interval  | 
            ||
| 25 | */  | 
            ||
| 26 | public function __construct(string $process, OutputInterface $output, int $interval = 100)  | 
            ||
| 34 | |||
| 35 | public function runProcess()  | 
            ||
| 42 | }  | 
            ||
| 43 | 
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: