| Conditions | 1 |
| Paths | 1 |
| Total Lines | 43 |
| Code Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function init() |
||
| 17 | { |
||
| 18 | $this->db->setVerbose(); |
||
|
|
|||
| 19 | $this->db->dropTableIfExists('canswers')->execute(); |
||
| 20 | |||
| 21 | $this->db->createTable( |
||
| 22 | 'canswers', |
||
| 23 | [ |
||
| 24 | 'id' => ['integer', 'primary key', 'not null', 'auto_increment'], |
||
| 25 | 'content' => ['varchar(1024)'], |
||
| 26 | 'q_id' => ['int'], |
||
| 27 | 'user_id' => ['int'], |
||
| 28 | 'vote' => ['int'], |
||
| 29 | 'created' => ['datetime'], |
||
| 30 | 'accepted' => ['bool'], |
||
| 31 | ] |
||
| 32 | )->execute(); |
||
| 33 | $this->db->insert( |
||
| 34 | 'canswers', |
||
| 35 | ['content', 'q_id', 'user_id', 'vote', 'created', 'accepted'] |
||
| 36 | ); |
||
| 37 | |||
| 38 | $now = time(); |
||
| 39 | |||
| 40 | $this->db->execute([ |
||
| 41 | 'That is a difficult *question*. Its a little bit more then 3.', |
||
| 42 | 1, |
||
| 43 | 2, |
||
| 44 | 0, |
||
| 45 | $now, |
||
| 46 | false, |
||
| 47 | ]); |
||
| 48 | |||
| 49 | $this->db->execute([ |
||
| 50 | 'I think it is 6,28.', |
||
| 51 | 2, |
||
| 52 | 1, |
||
| 53 | 0, |
||
| 54 | $now, |
||
| 55 | false, |
||
| 56 | ]); |
||
| 57 | |||
| 58 | } |
||
| 59 | /** |
||
| 77 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.