1 | <?php |
||
2 | |||
3 | use BMorais\Database\Crud; |
||
4 | use BMorais\Database\CrudBuilder; |
||
5 | |||
6 | class ExampleDao extends CrudBuilder { |
||
7 | |||
8 | |||
9 | public function __construct() |
||
10 | { |
||
11 | $this->setTableName("EXAMPLE"); |
||
12 | $this->setClassModel("exampleModel"); |
||
13 | } |
||
14 | |||
15 | public function findName(): array { |
||
16 | $this->selectBuilder() |
||
17 | ->where("NOME=?",["Joao"]) |
||
18 | ->orderBy("NOME") |
||
19 | ->executeQuery() |
||
20 | ->fetchArrayAssoc(); |
||
0 ignored issues
–
show
|
|||
21 | } |
||
22 | } |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: