| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 35 | protected function executeSQL($sql, array $parameters = array()) |
||
| 36 | { |
||
| 37 | $em = $this->container->get('doctrine')->getManager(); |
||
| 38 | $stmt = $em->getConnection()->prepare($sql); |
||
| 39 | foreach ($parameters as $name => $value) { |
||
| 40 | $stmt->bindValue($name, $value); |
||
| 41 | } |
||
| 42 | $stmt->execute(); |
||
| 43 | return $stmt; |
||
| 44 | } |
||
| 45 | |||
| 58 |
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: