@@ -6,15 +6,15 @@ |
||
6 | 6 | class Answer extends ActiveRecordModel |
7 | 7 | { |
8 | 8 | /** |
9 | - * @var string $tableName name of the database table. |
|
10 | - */ |
|
9 | + * @var string $tableName name of the database table. |
|
10 | + */ |
|
11 | 11 | protected $tableName = "Svar"; |
12 | 12 | |
13 | 13 | /** |
14 | - * Columns in the table. |
|
15 | - * |
|
16 | - * @var integer $id primary key auto incremented. |
|
17 | - */ |
|
14 | + * Columns in the table. |
|
15 | + * |
|
16 | + * @var integer $id primary key auto incremented. |
|
17 | + */ |
|
18 | 18 | public $id; |
19 | 19 | public $content; |
20 | 20 | public $question_id; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | "submit" => [ |
51 | 51 | "type" => "submit", |
52 | 52 | "value" => "Answer", |
53 | - "callback" => [$this, "callbackSubmit"] |
|
53 | + "callback" => [ $this, "callbackSubmit" ] |
|
54 | 54 | ], |
55 | 55 | ] |
56 | 56 | ); |
@@ -63,7 +63,7 @@ |
||
63 | 63 | * |
64 | 64 | * @return boolean true if okey, false if something went wrong. |
65 | 65 | */ |
66 | - public function callbackSubmit() |
|
66 | + public function callbackSubmit() |
|
67 | 67 | { |
68 | 68 | // Get values from the submitted form |
69 | 69 | $title = $this->form->value("title"); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | "submit" => [ |
50 | 50 | "type" => "submit", |
51 | 51 | "value" => "Skapa inlägg", |
52 | - "callback" => [$this, "callbackSubmit"] |
|
52 | + "callback" => [ $this, "callbackSubmit" ] |
|
53 | 53 | ], |
54 | 54 | ] |
55 | 55 | ); |
@@ -6,15 +6,15 @@ |
||
6 | 6 | class Forum extends ActiveRecordModel |
7 | 7 | { |
8 | 8 | /** |
9 | - * @var string $tableName name of the database table. |
|
10 | - */ |
|
9 | + * @var string $tableName name of the database table. |
|
10 | + */ |
|
11 | 11 | protected $tableName = "Forum"; |
12 | 12 | |
13 | 13 | /** |
14 | - * Columns in the table. |
|
15 | - * |
|
16 | - * @var integer $id primary key auto incremented. |
|
17 | - */ |
|
14 | + * Columns in the table. |
|
15 | + * |
|
16 | + * @var integer $id primary key auto incremented. |
|
17 | + */ |
|
18 | 18 | public $id; |
19 | 19 | public $title; |
20 | 20 | public $content; |
@@ -27,28 +27,28 @@ discard block |
||
27 | 27 | [ |
28 | 28 | "Titel" => [ |
29 | 29 | "type" => "text", |
30 | - "validation" => ["not_empty"], |
|
30 | + "validation" => [ "not_empty" ], |
|
31 | 31 | ], |
32 | 32 | |
33 | 33 | "Beskrivning" => [ |
34 | 34 | "type" => "text", |
35 | - "validation" => ["not_empty"], |
|
35 | + "validation" => [ "not_empty" ], |
|
36 | 36 | ], |
37 | 37 | |
38 | 38 | "Författare" => [ |
39 | 39 | "type" => "text", |
40 | - "validation" => ["not_empty"], |
|
40 | + "validation" => [ "not_empty" ], |
|
41 | 41 | ], |
42 | 42 | |
43 | 43 | "Bild" => [ |
44 | 44 | "type" => "text", |
45 | - "validation" => ["not_empty"], |
|
45 | + "validation" => [ "not_empty" ], |
|
46 | 46 | ], |
47 | 47 | |
48 | 48 | "submit" => [ |
49 | 49 | "type" => "submit", |
50 | 50 | "value" => "Create item", |
51 | - "callback" => [$this, "callbackSubmit"] |
|
51 | + "callback" => [ $this, "callbackSubmit" ] |
|
52 | 52 | ], |
53 | 53 | ] |
54 | 54 | ); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | $book = new Book(); |
68 | 68 | $book->setDb($this->di->get("dbqb")); |
69 | - $book->column1 = $this->form->value("Titel"); |
|
69 | + $book->column1 = $this->form->value("Titel"); |
|
70 | 70 | $book->column2 = $this->form->value("Beskrivning"); |
71 | 71 | $book->column3 = $this->form->value("Författare"); |
72 | 72 | $book->column4 = $this->form->value("Bild"); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | "submit" => [ |
35 | 35 | "type" => "submit", |
36 | 36 | "value" => "Delete item", |
37 | - "callback" => [$this, "callbackSubmit"] |
|
37 | + "callback" => [ $this, "callbackSubmit" ] |
|
38 | 38 | ], |
39 | 39 | ] |
40 | 40 | ); |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $book = new Book(); |
53 | 53 | $book->setDb($this->di->get("dbqb")); |
54 | 54 | |
55 | - $books = ["-1" => "Select an item..."]; |
|
55 | + $books = [ "-1" => "Select an item..." ]; |
|
56 | 56 | foreach ($book->findAll() as $obj) { |
57 | - $books[$obj->id] = "{$obj->column1} ({$obj->id})"; |
|
57 | + $books[ $obj->id ] = "{$obj->column1} ({$obj->id})"; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | return $books; |
@@ -29,39 +29,39 @@ discard block |
||
29 | 29 | [ |
30 | 30 | "id" => [ |
31 | 31 | "type" => "text", |
32 | - "validation" => ["not_empty"], |
|
32 | + "validation" => [ "not_empty" ], |
|
33 | 33 | "readonly" => true, |
34 | 34 | "value" => $book->id, |
35 | 35 | ], |
36 | 36 | |
37 | 37 | "Titel" => [ |
38 | 38 | "type" => "text", |
39 | - "validation" => ["not_empty"], |
|
39 | + "validation" => [ "not_empty" ], |
|
40 | 40 | "value" => $book->column1, |
41 | 41 | ], |
42 | 42 | |
43 | 43 | "Beskrivning" => [ |
44 | 44 | "type" => "text", |
45 | - "validation" => ["not_empty"], |
|
45 | + "validation" => [ "not_empty" ], |
|
46 | 46 | "value" => $book->column2, |
47 | 47 | ], |
48 | 48 | |
49 | 49 | "Författare" => [ |
50 | 50 | "type" => "text", |
51 | - "validation" => ["not_empty"], |
|
51 | + "validation" => [ "not_empty" ], |
|
52 | 52 | "value" => $book->column3, |
53 | 53 | ], |
54 | 54 | |
55 | 55 | "Bild" => [ |
56 | 56 | "type" => "text", |
57 | - "validation" => ["not_empty"], |
|
57 | + "validation" => [ "not_empty" ], |
|
58 | 58 | "value" => $book->column4, |
59 | 59 | ], |
60 | 60 | |
61 | 61 | "submit" => [ |
62 | 62 | "type" => "submit", |
63 | 63 | "value" => "Save", |
64 | - "callback" => [$this, "callbackSubmit"] |
|
64 | + "callback" => [ $this, "callbackSubmit" ] |
|
65 | 65 | ], |
66 | 66 | |
67 | 67 | "reset" => [ |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $book = new Book(); |
102 | 102 | $book->setDb($this->di->get("dbqb")); |
103 | 103 | $book->find("id", $this->form->value("id")); |
104 | - $book->column1 = $this->form->value("Titel"); |
|
104 | + $book->column1 = $this->form->value("Titel"); |
|
105 | 105 | $book->column2 = $this->form->value("Beskrivning"); |
106 | 106 | $book->column3 = $this->form->value("Författare"); |
107 | 107 | $book->column4 = $this->form->value("Bild"); |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | class CurlWrapModel implements ContainerInjectableInterface |
9 | 9 | { |
10 | 10 | use ContainerInjectableTrait; |
11 | - public $ipData = []; |
|
12 | - public $weatherData = []; |
|
13 | - public $map = []; |
|
11 | + public $ipData = [ ]; |
|
12 | + public $weatherData = [ ]; |
|
13 | + public $map = [ ]; |
|
14 | 14 | |
15 | 15 | public function getIpData($address, $key) |
16 | 16 | { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function getWeatherData($weatherKey) |
31 | 31 | { |
32 | - $curl = curl_init('https://api.darksky.net/forecast/' . $weatherKey . '/' . $this->ipData["latitude"] . "," . $this->ipData["longitude"]); |
|
32 | + $curl = curl_init('https://api.darksky.net/forecast/' . $weatherKey . '/' . $this->ipData[ "latitude" ] . "," . $this->ipData[ "longitude" ]); |
|
33 | 33 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
34 | 34 | |
35 | 35 | // Store the data: |
@@ -10,7 +10,7 @@ |
||
10 | 10 | use ContainerInjectableTrait; |
11 | 11 | |
12 | 12 | private $key = "dad69a7f7d97fbb294571c08291110d7"; |
13 | - public $result= []; |
|
13 | + public $result = [ ]; |
|
14 | 14 | |
15 | 15 | public function validateIp($address) |
16 | 16 | { |