Completed
Pull Request — master (#22)
by Lars
28:29 queued 11:45
created
scripts/user/elevforeningen/newsletter_submit.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,9 +72,13 @@
 block discarded – undo
72 72
 $contacts = $contact->getList();
73 73
 $i = 0;
74 74
 foreach ($contacts as $contact) {
75
-    if (empty($contact['email'])) continue;
76
-    if ($subscriber->addContact(new Contact($kernel, $contact['id']))) $i++;
77
-}
75
+    if (empty($contact['email'])) {
76
+        continue;
77
+    }
78
+    if ($subscriber->addContact(new Contact($kernel, $contact['id']))) {
79
+        $i++;
80
+    }
81
+    }
78 82
 echo $i;
79 83
 
80 84
 
Please login to merge, or discard this patch.
scripts/user/elevforeningen/ef.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         continue;
52 52
     }
53 53
 
54
-    echo $debtor['id'] . ' order set as sent';
54
+    echo $debtor['id'].' order set as sent';
55 55
     $d = Debtor::factory($kernel, $debtor['id']);
56 56
     $d->setStatus('sent');
57 57
 
Please login to merge, or discard this patch.
scripts/user/carmakoma_contacts_to_newsletter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 while ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
46
-    echo $row['number']. ', ' . $row['id']. ', ' . $row['date_created'] . ', '.$row['email']. ', '. $row['name']. ', ';
46
+    echo $row['number'].', '.$row['id'].', '.$row['date_created'].', '.$row['email'].', '.$row['name'].', ';
47 47
     
48
-    $newsletter = $db->query('SELECT id FROM newsletter_subscriber WHERE contact_id = '. $row['id']);
48
+    $newsletter = $db->query('SELECT id FROM newsletter_subscriber WHERE contact_id = '.$row['id']);
49 49
     if ($newsletter->numRows() == 0) {
50 50
         $subscriber = new NewsletterSubscriber($list);
51 51
         $contact = new Contact($kernel, $row['id']);
@@ -60,6 +60,6 @@  discard block
 block discarded – undo
60 60
     $i++;
61 61
 }
62 62
 
63
-echo $i. " number of contacts";
63
+echo $i." number of contacts";
64 64
 
65 65
 ?>
66 66
\ No newline at end of file
Please login to merge, or discard this patch.
scripts/cleanup_database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 }
18 18
 
19 19
 if (empty($opts->k) OR empty($opts->fk) OR empty($opts->ft) OR empty($opts->t)) {
20
-    echo 'not used correctly' . "\n";
20
+    echo 'not used correctly'."\n";
21 21
     exit(1);
22 22
 }
23 23
 
Please login to merge, or discard this patch.
install/Install.php 3 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -126,6 +126,9 @@  discard block
 block discarded – undo
126 126
 
127 127
     }
128 128
 
129
+    /**
130
+     * @param string $f
131
+     */
129 132
     function deleteUploadDirectory($f)
130 133
     {
131 134
         if ( is_dir( $f ) ){
@@ -142,6 +145,7 @@  discard block
 block discarded – undo
142 145
 
143 146
     /**
144 147
      * grants access to given modules
148
+     * @param string $modules
145 149
      */
146 150
     public function grantModuleAccess($modules)
147 151
     {
@@ -234,6 +238,7 @@  discard block
 block discarded – undo
234 238
 
235 239
     /**
236 240
      * splits a mysql export into separate
241
+     * @param string $sql
237 242
      */
238 243
     static function splitSql($sql)
239 244
     {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 
27 27
     function dropDatabase()
28 28
     {
29
-        $result = $this->db->query("SHOW TABLES FROM " . DB_NAME);
29
+        $result = $this->db->query("SHOW TABLES FROM ".DB_NAME);
30 30
         if (PEAR::isError($result)) {
31 31
             throw new Exception($result->getUserInfo());
32 32
         }
33 33
 
34 34
         while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
35
-            $drop = $this->db->exec('DROP TABLE ' . $line['tables_in_' . DB_NAME]);
35
+            $drop = $this->db->exec('DROP TABLE '.$line['tables_in_'.DB_NAME]);
36 36
             if (PEAR::IsError($drop)) {
37 37
                 throw new Exception($drop->getUserInfo());
38 38
             }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     function createDatabaseSchema()
44 44
     {
45
-        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-structure.sql');
45
+        $sql_structure = file_get_contents(dirname(__FILE__).'/database-structure.sql');
46 46
         $sql_arr = Intraface_Install::splitSql($sql_structure);
47 47
 
48 48
         foreach ($sql_arr as $sql) {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             }
54 54
         }
55 55
 
56
-        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql');
56
+        $sql_structure = file_get_contents(dirname(__FILE__).'/database-update.sql');
57 57
         $sql_arr = Intraface_Install::splitSql($sql_structure);
58 58
 
59 59
         foreach ($sql_arr as $sql) {
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 
69 69
     function emptyDatabase()
70 70
     {
71
-        $result = $this->db->query("SHOW TABLES FROM " . DB_NAME);
71
+        $result = $this->db->query("SHOW TABLES FROM ".DB_NAME);
72 72
         if (PEAR::isError($result)) {
73 73
             throw new Exception($result->getUserInfo());
74 74
         }
75 75
         while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
76
-            $truncate = $this->db->exec('TRUNCATE TABLE ' . $line['Tables_in_'.DB_NAME]);
76
+            $truncate = $this->db->exec('TRUNCATE TABLE '.$line['Tables_in_'.DB_NAME]);
77 77
             if (PEAR::IsError($truncate)) {
78 78
                 throw new Exception($truncate->getUserInfo());
79 79
             }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     function createStartingValues()
86 86
     {
87
-        $sql_values = file_get_contents(dirname(__FILE__) . '/database-values.sql');
87
+        $sql_values = file_get_contents(dirname(__FILE__).'/database-values.sql');
88 88
         $sql_arr = Intraface_Install::splitSql($sql_values);
89 89
 
90 90
         foreach ($sql_arr as $sql) {
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
 
129 129
     function deleteUploadDirectory($f)
130 130
     {
131
-        if ( is_dir( $f ) ){
132
-            foreach ( scandir( $f ) as $item ){
133
-                if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) )
131
+        if (is_dir($f)) {
132
+            foreach (scandir($f) as $item) {
133
+                if (!strcmp($item, '.') || !strcmp($item, '..'))
134 134
                     continue;
135
-                $this->deleteUploadDirectory( $f . "/" . $item );
135
+                $this->deleteUploadDirectory($f."/".$item);
136 136
             }
137
-            rmdir( $f );
138
-        } else{
139
-            @unlink( $f );
137
+            rmdir($f);
138
+        } else {
139
+            @unlink($f);
140 140
         }
141 141
     }
142 142
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $object_method[0] = str_replace('/', '', $object_method[0]);
216 216
             $object_method[0] = str_replace('\\', '', $object_method[0]);
217 217
 
218
-            require_once dirname(__FILE__) . '/Helper/'.$object_method[0].'.php';
218
+            require_once dirname(__FILE__).'/Helper/'.$object_method[0].'.php';
219 219
             $object_name = 'Install_Helper_'.$object_method[0];
220 220
             $object = new $object_name($kernel, $this->db);
221 221
             $object->$object_method[1]();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,8 +130,9 @@
 block discarded – undo
130 130
     {
131 131
         if ( is_dir( $f ) ){
132 132
             foreach ( scandir( $f ) as $item ){
133
-                if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) )
134
-                    continue;
133
+                if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) {
134
+                                    continue;
135
+                }
135 136
                 $this->deleteUploadDirectory( $f . "/" . $item );
136 137
             }
137 138
             rmdir( $f );
Please login to merge, or discard this patch.
src/Intraface/Amount.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
     /**
51 51
      * Public: henter beløbet efter konvertering
52
-     * @return beløb
52
+     * @return double
53 53
      */
54 54
     function get()
55 55
     {
Please login to merge, or discard this patch.
src/Intraface/Auth.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     /**
44 44
      * hasIdentity()
45 45
      *
46
-     * @return mixed user id or false
46
+     * @return boolean user id or false
47 47
      */
48 48
     public function hasIdentity()
49 49
     {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     /**
84 84
      * Implements the observer pattern
85 85
      *
86
-     * @param object $observer
86
+     * @param Intraface_Log $observer
87 87
      *
88 88
      * @return boolean
89 89
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@
 block discarded – undo
32 32
         }
33 33
 
34 34
         if ($object = $adapter->auth()) {
35
-            $this->notifyObservers('login', $identification . ' logged in');
35
+            $this->notifyObservers('login', $identification.' logged in');
36 36
         } else {
37
-            $this->notifyObservers('login', $identification . ' could not login');
37
+            $this->notifyObservers('login', $identification.' could not login');
38 38
         }
39 39
 
40 40
         return $object;
Please login to merge, or discard this patch.
src/Intraface/Controller/TestLogin.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -54,6 +54,10 @@
 block discarded – undo
54 54
         return $this->render();
55 55
     }
56 56
 
57
+    /**
58
+     * @param string $username
59
+     * @param string $password
60
+     */
57 61
     protected function selectUser($username, $password)
58 62
     {
59 63
         $adapter = new Intraface_Auth_User($this->mdb2, $this->session()->sessionId(), $username, $password);
Please login to merge, or discard this patch.
src/Intraface/Intranet.php 2 patches
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@  discard block
 block discarded – undo
36 36
     /**
37 37
      * Constructor
38 38
      *
39
-     * @param integer $intranet_id The id of the intranet
40 39
      *
41 40
      * @return void
42 41
      */
@@ -59,7 +58,7 @@  discard block
 block discarded – undo
59 58
     /**
60 59
      * loads
61 60
      *
62
-     * @return void
61
+     * @return integer|null
63 62
      */
64 63
     function load()
65 64
     {
@@ -103,9 +102,9 @@  discard block
 block discarded – undo
103 102
      * @todo might be smarter to throw in an actual module object
104 103
      *       that would make us sure that it is actually valid
105 104
      *
106
-     * @param mixed $module The id or name of the module
105
+     * @param string $module The id or name of the module
107 106
      *
108
-     * @return void
107
+     * @return boolean
109 108
      */
110 109
     function hasModuleAccess($module)
111 110
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
      */
110 110
     function hasModuleAccess($module)
111 111
     {
112
-        $filename = PATH_INCLUDE_MODULE . $module . '/Main' . ucfirst($module) . '.php';
112
+        $filename = PATH_INCLUDE_MODULE.$module.'/Main'.ucfirst($module).'.php';
113 113
         if (file_exists($filename)) {
114 114
             require_once $filename;
115 115
             $module_class = 'Main'.ucfirst($module);
Please login to merge, or discard this patch.