Completed
Push — master ( a25e67...f5286a )
by Johanna
07:35
created
autoloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  * @return void
13 13
  */
14 14
 spl_autoload_register(
15
-    function ($class) {
15
+    function($class) {
16 16
 
17 17
         // project-specific namespace prefix
18 18
         //$prefix = 'Foo\\Bar\\';
Please login to merge, or discard this patch.
src/HTMLTable/CHTMLTable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 *
7 7
 */
8 8
 
9
-class CHTMLTable{ 
9
+class CHTMLTable { 
10 10
   
11 11
   private $data;
12 12
   
13 13
   //tar emot en headline som enkel array och data som tvådimensionell array
14
-  public function __construct($headline, $data){
14
+  public function __construct($headline, $data) {
15 15
     $this->data = $data;
16 16
     $this->headline = $headline;
17 17
   }
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
   * @return string $html, sträng innehållande en tabell
25 25
   */
26 26
    
27
-  public function getTable(){
27
+  public function getTable() {
28 28
     
29 29
     $table = "";
30 30
     
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
       <table class>
33 33
         <tr class='rows'>";
34 34
         
35
-   foreach($this->headline as $h) {
36
-      $table.= "<th>" . $h ."</th>";
35
+   foreach ($this->headline as $h) {
36
+      $table .= "<th>" . $h . "</th>";
37 37
      }
38 38
    
39 39
    $table .= "</tr>";
40
-   foreach($this->data as $d){
40
+   foreach ($this->data as $d) {
41 41
      $table .= "<tr>";  
42 42
      foreach ($d as $v) {
43 43
        $table .= "<td>$v</td>";
44 44
      }
45 45
      $table .= "</tr>";
46 46
    }
47
-   $table .="</table></div>";
47
+   $table .= "</table></div>";
48 48
     
49 49
    return $table;
50 50
   }
Please login to merge, or discard this patch.
src/HTMLTable/TableController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
       
31 31
       //gör om arrayen av objekt till en array av arrayer
32 32
       foreach ($all as $key1=>$value) {
33
-        foreach ($value as $key2=>$v){
33
+        foreach ($value as $key2=>$v) {
34 34
           if (!in_array($key2, $noListing)) { //$noListing, parametrar som inte ska vara med
35 35
               $aContent[$key1][$key2] = $v;
36 36
           }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
       //hittar objektens parametrar/tabellens kolumnnamn och skapar
43 43
       //en ny array av rubriker
44 44
       foreach ($all as $key1=>$value) {
45
-        foreach ($value as $key2=>$v){
45
+        foreach ($value as $key2=>$v) {
46 46
           if (!in_array($key2, $noListing)) { //$noListing, parametrar som inte ska vara med
47 47
               $aHeading[] = $key2;
48 48
           }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
       ]);
64 64
   }
65 65
   
66
-   public function initAction($model){ //används för att befolka databasen, bara för att testa
66
+   public function initAction($model) { //används för att befolka databasen, bara för att testa
67 67
     $model->setDI($this->di);
68 68
     $model->init();
69 69
   }
Please login to merge, or discard this patch.
webroot/table.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__.'/config_with_app.php'; 
3
+require __DIR__ . '/config_with_app.php'; 
4 4
 
5 5
 $app->url->setUrlType(\Anax\Url\CUrl::URL_CLEAN); 
6 6
 
7 7
 
8 8
 // Create services and inject into the app. 
9
-$di  = new \Anax\DI\CDIFactoryDefault();
9
+$di = new \Anax\DI\CDIFactoryDefault();
10 10
 
11 11
 $di->set('TableController', function() use ($di){
12 12
             $controller = new \Jovis\HTMLTable\TableController();
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 
33 33
     $app->theme->setTitle("HTML-tabell");
34 34
       
35
-    $model = new Jovis\DatabaseModel\Movie();  // modellen man vill skriva ut som html-tabell                                                                                                     
35
+    $model = new Jovis\DatabaseModel\Movie(); // modellen man vill skriva ut som html-tabell                                                                                                     
36 36
       
37 37
     
38
-    $app->dispatcher->forward([ //används bara för att skapa tabell och befolka databasen, för test
38
+    $app->dispatcher->forward([//används bara för att skapa tabell och befolka databasen, för test
39 39
         'controller' => 'table',
40 40
         'action'     => 'init',
41 41
         'params'    => [$model],
Please login to merge, or discard this patch.
src/DatabaseModel/CDatabaseModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
    */
141 141
   public function update($values)
142 142
   {
143
-	  $keys   = array_keys($values);
143
+	  $keys = array_keys($values);
144 144
       $values = array_values($values);
145 145
    
146 146
       // Its update, remove id and use as where-clause
Please login to merge, or discard this patch.