@@ -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 | { |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * "dsn" => "sqlite:memory::", |
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | -if ($_SERVER["SERVER_NAME"] === "www.student.bth.se") { |
|
| 17 | +if ($_SERVER[ "SERVER_NAME" ] === "www.student.bth.se") { |
|
| 18 | 18 | return [ |
| 19 | 19 | "dsn" => "mysql:host=blu-ray.student.bth.se;dbname=mos;", |
| 20 | 20 | "username" => "mos", |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | error_reporting(-1); // Report all type of errors |
| 25 | 25 | //error_reporting(E_ALL ^ E_DEPRECATED); // Report no deprecated errors |
| 26 | 26 | if (constant("ANAX_DEVELOPMENT")) { |
| 27 | - ini_set("display_errors", 1); // Display all errors |
|
| 27 | + ini_set("display_errors", 1); // Display all errors |
|
| 28 | 28 | } elseif (constant("ANAX_PRODUCTION")) { |
| 29 | - ini_set("display_errors", 0); // Display no errors |
|
| 30 | - ini_set("log_errors", 1); // Log errors to file error_log |
|
| 29 | + ini_set("display_errors", 0); // Display no errors |
|
| 30 | + ini_set("log_errors", 1); // Log errors to file error_log |
|
| 31 | 31 | ini_set("error_log", ANAX_INSTALL_PATH . "/log/error_log"); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * Default exception handler. |
| 38 | 38 | */ |
| 39 | -set_exception_handler(function ($e) { |
|
| 39 | +set_exception_handler(function($e) { |
|
| 40 | 40 | echo "<p>Anax: Uncaught exception:</p><p>Line " |
| 41 | 41 | . $e->getLine() |
| 42 | 42 | . " in file " |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | "services" => [ |
| 7 | 7 | "textfilter" => [ |
| 8 | 8 | "shared" => true, |
| 9 | - "callback" => function () { |
|
| 9 | + "callback" => function() { |
|
| 10 | 10 | $filter = new \Anax\TextFilter\TextFilter(); |
| 11 | 11 | if (is_dir(ANAX_INSTALL_PATH . "/content")) { |
| 12 | 12 | $filter->setFilterConfig("frontmatter", [ |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | "services" => [ |
| 9 | 9 | "configuration" => [ |
| 10 | 10 | "shared" => true, |
| 11 | - "callback" => function () { |
|
| 11 | + "callback" => function() { |
|
| 12 | 12 | $config = new \Anax\Configure\Configuration(); |
| 13 | 13 | $dirs = require ANAX_INSTALL_PATH . "/config/configuration.php"; |
| 14 | 14 | $config->setBaseDirectories($dirs); |