| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | protected function getMySQLDatabaseByName($databases, $database_name) |
||
| 42 | { |
||
| 43 | $database_found = collect($databases)->filter(function ($database) use ($database_name) { |
||
| 44 | return $database['name'] === $database_name; |
||
| 45 | })->first(); |
||
| 46 | |||
| 47 | if ($database_found) { |
||
| 48 | return $database_found; |
||
| 49 | } |
||
| 50 | return null; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
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: