Completed
Push — master ( e5009d...834394 )
by Igor
02:30
created
c3.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -31,6 +31,10 @@
 block discarded – undo
31 31
 }
32 32
 
33 33
 if (!function_exists('__c3_error')) {
34
+
35
+    /**
36
+     * @param string $message
37
+     */
34 38
     function __c3_error($message)
35 39
     {
36 40
 /*        file_put_contents(C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt', $message);
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 
44 44
 // Autoload Codeception classes
45 45
 if (!class_exists('\\Codeception\\Codecept')) {
46
-    if (stream_resolve_include_path(__DIR__ . '/vendor/autoload.php')) {
47
-        require_once __DIR__ . '/vendor/autoload.php';
48
-    } elseif (file_exists(__DIR__ . '/codecept.phar')) {
49
-        require_once 'phar://'.__DIR__ . '/codecept.phar/autoload.php';
46
+    if (stream_resolve_include_path(__DIR__.'/vendor/autoload.php')) {
47
+        require_once __DIR__.'/vendor/autoload.php';
48
+    } elseif (file_exists(__DIR__.'/codecept.phar')) {
49
+        require_once 'phar://'.__DIR__.'/codecept.phar/autoload.php';
50 50
     } elseif (stream_resolve_include_path('Codeception/autoload.php')) {
51 51
         require_once 'Codeception/autoload.php';
52 52
     } else {
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 }
56 56
 
57 57
 // Load Codeception Config
58
-$config_file = realpath(__DIR__) . DIRECTORY_SEPARATOR . 'codeception.yml';
58
+$config_file = realpath(__DIR__).DIRECTORY_SEPARATOR.'codeception.yml';
59 59
 if (isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'])) {
60
-    $config_file = realpath(__DIR__) . DIRECTORY_SEPARATOR . $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'];
60
+    $config_file = realpath(__DIR__).DIRECTORY_SEPARATOR.$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'];
61 61
 }
62 62
 if (!file_exists($config_file)) {
63 63
     __c3_error(sprintf("Codeception config file '%s' not found", $config_file));
@@ -73,31 +73,31 @@  discard block
 block discarded – undo
73 73
     // workaround for 'zend_mm_heap corrupted' problem
74 74
     gc_disable();
75 75
 
76
-    if ((integer)ini_get('memory_limit') < 384) {
76
+    if ((integer) ini_get('memory_limit') < 384) {
77 77
         ini_set('memory_limit', '384M');
78 78
     }
79 79
 
80
-    define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::logDir() . 'c3tmp');
80
+    define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::logDir().'c3tmp');
81 81
     define('C3_CODECOVERAGE_PROJECT_ROOT', Codeception\Configuration::projectDir());
82 82
     define('C3_CODECOVERAGE_TESTNAME', $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']);
83 83
 
84 84
     function __c3_build_html_report(PHP_CodeCoverage $codeCoverage, $path)
85 85
     {
86 86
         $writer = new PHP_CodeCoverage_Report_HTML();
87
-        $writer->process($codeCoverage, $path . 'html');
87
+        $writer->process($codeCoverage, $path.'html');
88 88
 
89
-        if (file_exists($path . '.tar')) {
90
-            unlink($path . '.tar');
89
+        if (file_exists($path.'.tar')) {
90
+            unlink($path.'.tar');
91 91
         }
92 92
 
93
-        $phar = new PharData($path . '.tar');
93
+        $phar = new PharData($path.'.tar');
94 94
         $phar->setSignatureAlgorithm(Phar::SHA1);
95
-        $files = $phar->buildFromDirectory($path . 'html');
95
+        $files = $phar->buildFromDirectory($path.'html');
96 96
         array_map('unlink', $files);
97 97
 
98 98
         if (in_array('GZ', Phar::getSupportedCompression())) {
99
-            if (file_exists($path . '.tar.gz')) {
100
-                unlink($path . '.tar.gz');
99
+            if (file_exists($path.'.tar.gz')) {
100
+                unlink($path.'.tar.gz');
101 101
             }
102 102
 
103 103
             $phar->compress(\Phar::GZ);
@@ -105,19 +105,19 @@  discard block
 block discarded – undo
105 105
             // close the file so that we can rename it
106 106
             unset($phar);
107 107
 
108
-            unlink($path . '.tar');
109
-            rename($path . '.tar.gz', $path . '.tar');
108
+            unlink($path.'.tar');
109
+            rename($path.'.tar.gz', $path.'.tar');
110 110
         }
111 111
 
112
-        return $path . '.tar';
112
+        return $path.'.tar';
113 113
     }
114 114
 
115 115
     function __c3_build_clover_report(PHP_CodeCoverage $codeCoverage, $path)
116 116
     {
117 117
         $writer = new PHP_CodeCoverage_Report_Clover();
118
-        $writer->process($codeCoverage, $path . '.clover.xml');
118
+        $writer->process($codeCoverage, $path.'.clover.xml');
119 119
 
120
-        return $path . '.clover.xml';
120
+        return $path.'.clover.xml';
121 121
     }
122 122
 
123 123
     function __c3_send_file($filename)
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
 
179 179
 if (!is_dir(C3_CODECOVERAGE_MEDIATE_STORAGE)) {
180 180
     if (mkdir(C3_CODECOVERAGE_MEDIATE_STORAGE, 0777, true) === false) {
181
-        __c3_error('Failed to create directory "' . C3_CODECOVERAGE_MEDIATE_STORAGE . '"');
181
+        __c3_error('Failed to create directory "'.C3_CODECOVERAGE_MEDIATE_STORAGE.'"');
182 182
     }
183 183
 }
184 184
 
185 185
 // evaluate base path for c3-related files
186
-$path = realpath(C3_CODECOVERAGE_MEDIATE_STORAGE) . DIRECTORY_SEPARATOR . 'codecoverage';
186
+$path = realpath(C3_CODECOVERAGE_MEDIATE_STORAGE).DIRECTORY_SEPARATOR.'codecoverage';
187 187
 
188 188
 $requested_c3_report = (strpos($_SERVER['REQUEST_URI'], 'c3/report') !== false);
189 189
 
190
-$complete_report = $current_report = $path . '.serialized';
190
+$complete_report = $current_report = $path.'.serialized';
191 191
 if ($requested_c3_report) {
192 192
     set_time_limit(0);
193 193
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     $codeCoverage->start(C3_CODECOVERAGE_TESTNAME);
230 230
     if (!array_key_exists('HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG', $_SERVER)) { 
231 231
         register_shutdown_function(
232
-            function () use ($codeCoverage, $current_report) {
232
+            function() use ($codeCoverage, $current_report) {
233 233
                 $codeCoverage->stop();
234 234
                 file_put_contents($current_report, serialize($codeCoverage));
235 235
             }
Please login to merge, or discard this patch.
modules/admin/controllers/UserController.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     /**
52 52
      * Lists all users.
53
-     * @return mixed
53
+     * @return string
54 54
      */
55 55
     public function actionIndex()
56 56
     {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * Deletes an existing UserModel model.
110 110
      * If deletion is successful, the browser will be redirected to the 'index' page.
111 111
      * @param integer $id
112
-     * @return mixed
112
+     * @return \yii\web\Response
113 113
      */
114 114
     public function actionDelete($id)
115 115
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use yii\web\NotFoundHttpException;
10 10
 use yii\filters\VerbFilter;
11 11
 use yii2mod\editable\EditableAction;
12
-use yii2mod\user\models\SignupForm;
13 12
 
14 13
 /**
15 14
  * UserController implements the CRUD actions for UserModel model.
Please login to merge, or discard this patch.
views/layouts/main.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,4 @@
 block discarded – undo
1 1
 <?php
2
-use app\widgets\Alert;
3 2
 use kartik\alert\AlertBlock;
4 3
 use yii\helpers\Html;
5 4
 use yii\bootstrap\Nav;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $menuItems[] = '<li>'
53 53
             . Html::beginForm(['/site/logout'], 'post')
54 54
             . Html::submitButton(
55
-                'Logout (' . Yii::$app->user->identity->username . ')',
55
+                'Logout ('.Yii::$app->user->identity->username.')',
56 56
                 ['class' => 'btn btn-link']
57 57
             )
58 58
             . Html::endForm()
Please login to merge, or discard this patch.
assets/AppAsset.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link      http://www.yiiframework.com/
4
- * @copyright Copyright (c) 2008 Yii Software LLC
5
- * @license   http://www.yiiframework.com/license/
6
- */
3
+     * @link      http://www.yiiframework.com/
4
+     * @copyright Copyright (c) 2008 Yii Software LLC
5
+     * @license   http://www.yiiframework.com/license/
6
+     */
7 7
 
8 8
 namespace app\assets;
9 9
 
Please login to merge, or discard this patch.
config/common.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
         'mail' => [
37 37
             'class' => 'yii\swiftmailer\Mailer',
38 38
             'transport' => [
39
-              'class' => 'Swift_SmtpTransport',
40
-              'host' => 'host-here',
41
-          ],
39
+                'class' => 'Swift_SmtpTransport',
40
+                'host' => 'host-here',
41
+            ],
42 42
         ],
43 43
         'i18n' => [
44 44
             'translations' => [
Please login to merge, or discard this patch.
config/console.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-Yii::setAlias('@tests', dirname(__DIR__) . '/tests');
3
+Yii::setAlias('@tests', dirname(__DIR__).'/tests');
4 4
 Yii::setAlias('@webroot', dirname(__DIR__));
5 5
 
6 6
 $config = [
Please login to merge, or discard this patch.
migrations/m130524_201442_init.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
             'data' => 'LONGBLOB'
98 98
         ]);
99 99
 
100
-      $this->createTable('{{%AuthRule}}', [
100
+        $this->createTable('{{%AuthRule}}', [
101 101
             'name' => Schema::TYPE_STRING . '(64) NOT NULL',
102 102
             'data' => Schema::TYPE_TEXT,
103 103
             'created_at' => Schema::TYPE_INTEGER,
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
         //Create user table
23 23
         $this->createTable('{{%User}}', [
24 24
             'id' => Schema::TYPE_PK,
25
-            'username' => Schema::TYPE_STRING . ' NOT NULL',
26
-            'authKey' => Schema::TYPE_STRING . '(32) NOT NULL',
27
-            'passwordHash' => Schema::TYPE_STRING . ' NOT NULL',
25
+            'username' => Schema::TYPE_STRING.' NOT NULL',
26
+            'authKey' => Schema::TYPE_STRING.'(32) NOT NULL',
27
+            'passwordHash' => Schema::TYPE_STRING.' NOT NULL',
28 28
             'passwordResetToken' => Schema::TYPE_STRING,
29
-            'email' => Schema::TYPE_STRING . ' NOT NULL',
30
-            'status' => Schema::TYPE_SMALLINT . ' NOT NULL DEFAULT 10',
31
-            'createdAt' => Schema::TYPE_INTEGER . ' NOT NULL',
32
-            'updatedAt' => Schema::TYPE_INTEGER . ' NOT NULL',
29
+            'email' => Schema::TYPE_STRING.' NOT NULL',
30
+            'status' => Schema::TYPE_SMALLINT.' NOT NULL DEFAULT 10',
31
+            'createdAt' => Schema::TYPE_INTEGER.' NOT NULL',
32
+            'updatedAt' => Schema::TYPE_INTEGER.' NOT NULL',
33 33
             'lastLogin' => Schema::TYPE_INTEGER,
34 34
         ], $tableOptions);
35 35
 
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
         //Create Cms table
43 43
         $this->createTable('{{%Cms}}', [
44 44
             'id' => Schema::TYPE_PK,
45
-            'url' => Schema::TYPE_STRING . '(255)',
46
-            'title' => Schema::TYPE_STRING . '(255)',
45
+            'url' => Schema::TYPE_STRING.'(255)',
46
+            'title' => Schema::TYPE_STRING.'(255)',
47 47
             'content' => Schema::TYPE_TEXT,
48 48
             'status' => Schema::TYPE_SMALLINT,
49 49
             'metaTitle' => Schema::TYPE_TEXT,
50 50
             'metaDescription' => Schema::TYPE_TEXT,
51 51
             'metaKeywords' => Schema::TYPE_TEXT,
52
-            'createdAt' => Schema::TYPE_INTEGER . ' NOT NULL',
53
-            'updatedAt' => Schema::TYPE_INTEGER . ' NOT NULL',
52
+            'createdAt' => Schema::TYPE_INTEGER.' NOT NULL',
53
+            'updatedAt' => Schema::TYPE_INTEGER.' NOT NULL',
54 54
         ], $tableOptions);
55 55
 
56 56
         //Insert pages in CMS table
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         ]);
99 99
 
100 100
       $this->createTable('{{%AuthRule}}', [
101
-            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
101
+            'name' => Schema::TYPE_STRING.'(64) NOT NULL',
102 102
             'data' => Schema::TYPE_TEXT,
103 103
             'created_at' => Schema::TYPE_INTEGER,
104 104
             'updated_at' => Schema::TYPE_INTEGER,
@@ -106,45 +106,45 @@  discard block
 block discarded – undo
106 106
         ], $tableOptions);
107 107
         
108 108
         $this->createTable('{{%AuthItem}}', [
109
-            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
110
-            'type' => Schema::TYPE_INTEGER . ' NOT NULL',
109
+            'name' => Schema::TYPE_STRING.'(64) NOT NULL',
110
+            'type' => Schema::TYPE_INTEGER.' NOT NULL',
111 111
             'description' => Schema::TYPE_TEXT,
112
-            'rule_name' => Schema::TYPE_STRING . '(64)',
112
+            'rule_name' => Schema::TYPE_STRING.'(64)',
113 113
             'data' => Schema::TYPE_TEXT,
114 114
             'created_at' => Schema::TYPE_INTEGER,
115 115
             'updated_at' => Schema::TYPE_INTEGER,
116 116
             'PRIMARY KEY (name)',
117
-            'FOREIGN KEY (rule_name) REFERENCES ' . '{{%AuthRule}}' . ' (name) ON DELETE SET NULL ON UPDATE CASCADE',
117
+            'FOREIGN KEY (rule_name) REFERENCES '.'{{%AuthRule}}'.' (name) ON DELETE SET NULL ON UPDATE CASCADE',
118 118
         ], $tableOptions);
119 119
         
120 120
         $this->createIndex('idx-auth_item-type', '{{%AuthItem}}', 'type');
121 121
         
122 122
         $this->createTable('{{%AuthItemChild}}', [
123
-            'parent' => Schema::TYPE_STRING . '(64) NOT NULL',
124
-            'child' => Schema::TYPE_STRING . '(64) NOT NULL',
123
+            'parent' => Schema::TYPE_STRING.'(64) NOT NULL',
124
+            'child' => Schema::TYPE_STRING.'(64) NOT NULL',
125 125
             'PRIMARY KEY (parent, child)',
126
-            'FOREIGN KEY (parent) REFERENCES ' . '{{%AuthItem}}' . ' (name) ON DELETE CASCADE ON UPDATE CASCADE',
127
-            'FOREIGN KEY (child) REFERENCES ' . '{{%AuthItem}}' . ' (name) ON DELETE CASCADE ON UPDATE CASCADE',
126
+            'FOREIGN KEY (parent) REFERENCES '.'{{%AuthItem}}'.' (name) ON DELETE CASCADE ON UPDATE CASCADE',
127
+            'FOREIGN KEY (child) REFERENCES '.'{{%AuthItem}}'.' (name) ON DELETE CASCADE ON UPDATE CASCADE',
128 128
         ], $tableOptions);
129 129
         
130 130
         $this->createTable('{{%AuthAssignment}}', [
131
-            'item_name' => Schema::TYPE_STRING . '(64) NOT NULL',
132
-            'user_id' => Schema::TYPE_INTEGER . ' NOT NULL',
131
+            'item_name' => Schema::TYPE_STRING.'(64) NOT NULL',
132
+            'user_id' => Schema::TYPE_INTEGER.' NOT NULL',
133 133
             'created_at' => Schema::TYPE_INTEGER,
134 134
             'PRIMARY KEY (item_name, user_id)',
135
-            'FOREIGN KEY (item_name) REFERENCES ' . '{{%AuthItem}}' . ' (name) ON DELETE CASCADE ON UPDATE CASCADE',
135
+            'FOREIGN KEY (item_name) REFERENCES '.'{{%AuthItem}}'.' (name) ON DELETE CASCADE ON UPDATE CASCADE',
136 136
         ], $tableOptions);
137 137
 
138 138
         // Create Cron Shedule table
139
-        $this->createTable('{{%CronSchedule}}',[
139
+        $this->createTable('{{%CronSchedule}}', [
140 140
                 'id' => Schema::TYPE_PK,
141
-                'jobCode' => Schema::TYPE_STRING . '(255) NULL DEFAULT NULL',
142
-                'status' => Schema::TYPE_SMALLINT . ' NOT NULL',
143
-                'messages' => Schema::TYPE_TEXT . ' NULL',
144
-                'dateCreated' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
145
-                'dateScheduled' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
146
-                'dateExecuted' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
147
-                'dateFinished' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
141
+                'jobCode' => Schema::TYPE_STRING.'(255) NULL DEFAULT NULL',
142
+                'status' => Schema::TYPE_SMALLINT.' NOT NULL',
143
+                'messages' => Schema::TYPE_TEXT.' NULL',
144
+                'dateCreated' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
145
+                'dateScheduled' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
146
+                'dateExecuted' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
147
+                'dateFinished' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
148 148
             ],
149 149
             $tableOptions
150 150
         );
Please login to merge, or discard this patch.
models/UserModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             ['email', 'unique', 'message' => 'This email address has already been taken.'],
34 34
             ['username', 'unique', 'message' => 'This username has already been taken.'],
35 35
             ['username', 'string', 'min' => 2, 'max' => 30],
36
-            ['email','email'],
36
+            ['email', 'email'],
37 37
             ['password', 'string', 'min' => 6, 'max' => 24],
38 38
             ['password', 'required', 'on' => 'createUser'],
39 39
         ], parent::rules());
Please login to merge, or discard this patch.
modules/admin/views/layouts/column2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         'options' => ['class' => 'navbar-nav navbar-right'],
88 88
         'items' => [
89 89
             ['label' => '<i class="glyphicon glyphicon-globe"></i> Public Area', 'url' => ['/']],
90
-            ['label' => '<i class="glyphicon glyphicon-off"></i> Logout (' . Yii::$app->user->identity->username . ')',
90
+            ['label' => '<i class="glyphicon glyphicon-off"></i> Logout ('.Yii::$app->user->identity->username.')',
91 91
                 'url' => ['/site/logout'],
92 92
                 'linkOptions' => ['data-method' => 'post'],
93 93
             ]
Please login to merge, or discard this patch.