Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 578 Bytes

e8.md

File metadata and controls

36 lines (26 loc) · 578 Bytes

E8 No return type

Do you know what is annoying? Having to open a method that you did not write and have to read it, to find out what the return type is.

<?php

class Test{
    public function getInt():int{
        return 1;
    }

    public function getString():string{
      return "Easy";
    }

    public function isItDiff():bool{
      return false;
    }

    public function getUser():User{
        $user = new User();
        return $user();
    }

    public function toArray():array{
      return [];
    }

    public function stop():void{

    }
}