| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function loadTenants() { |
||
| 38 | $yaml = Yaml::parse(file_get_contents($this->resource)); |
||
| 39 | |||
| 40 | if (!is_array($yaml)) { |
||
| 41 | throw new \RuntimeException('YAML file didn\'t contain an array of tenants'); |
||
| 42 | } |
||
| 43 | |||
| 44 | $tenants = []; |
||
| 45 | |||
| 46 | // Convert them to Tenant objects |
||
| 47 | foreach ($yaml as $tenant) { |
||
| 48 | $tenants[$tenant] = new Tenant($tenant); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $tenants; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |