| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 69 | private function parseConfiguration(array $config) |
||
| 70 | { |
||
| 71 | $this->currentEnvironment = 'dev'; |
||
| 72 | foreach($config as $environment => $connection) { |
||
| 73 | if (isset($connection['dsn'])) { |
||
| 74 | $this->dsn[$environment] = $connection['dsn']; |
||
| 75 | } else { |
||
| 76 | $this->dsn[$environment]= sprintf('pgsql:host=%s; port=%s; dbname=%s;' |
||
| 77 | , $connection['host'] |
||
| 78 | , $connection['port'] |
||
| 79 | , $connection['database']); |
||
| 80 | |||
| 81 | } |
||
| 82 | //$this->adapter[$environment] = $connection['adapter']; |
||
| 83 | $this->username[$environment] = $connection['username']; |
||
| 84 | $this->password[$environment] = $connection['password']; |
||
| 85 | } |
||
| 86 | } |
||
| 87 | } |
||
| 88 |
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: