@@ -1,5 +1,4 @@ |
||
| 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; |
@@ -52,7 +52,7 @@ |
||
| 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() |
@@ -43,10 +43,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -1,6 +1,6 @@ |
||
| 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 = [ |
@@ -87,7 +87,7 @@ |
||
| 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 | ] |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | 'class' => EditableColumn::className(), |
| 37 | 37 | 'attribute' => 'status', |
| 38 | 38 | 'url' => ['edit-user'], |
| 39 | - 'value' => function ($model) { |
|
| 39 | + 'value' => function($model) { |
|
| 40 | 40 | return UserStatus::getLabel($model->status); |
| 41 | 41 | }, |
| 42 | 42 | 'type' => 'select', |
| 43 | - 'editableOptions' => function ($model) { |
|
| 43 | + 'editableOptions' => function($model) { |
|
| 44 | 44 | return [ |
| 45 | 45 | 'source' => Json::encode(UserStatus::listData()), |
| 46 | 46 | 'value' => $model->status, |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | [ |
| 53 | 53 | 'attribute' => 'createdAt', |
| 54 | 54 | 'label' => 'Created date', |
| 55 | - 'value' => function ($model) { |
|
| 55 | + 'value' => function($model) { |
|
| 56 | 56 | return date("d-M-Y", $model->createdAt); |
| 57 | 57 | }, |
| 58 | 58 | 'filter' => false, |
@@ -11,16 +11,16 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // you may need to adjust this path to the correct Yii framework path |
| 14 | -$frameworkPath = dirname(__FILE__) . '/vendor/yiisoft/yii2'; |
|
| 14 | +$frameworkPath = dirname(__FILE__).'/vendor/yiisoft/yii2'; |
|
| 15 | 15 | |
| 16 | 16 | if (!is_dir($frameworkPath)) { |
| 17 | 17 | echo '<h1>Error</h1>'; |
| 18 | 18 | echo '<p><strong>The path to yii framework seems to be incorrect.</strong></p>'; |
| 19 | - echo '<p>You need to install Yii framework via composer or adjust the framework path in file <abbr title="' . __FILE__ . '">' . basename(__FILE__) . '</abbr>.</p>'; |
|
| 20 | - echo '<p>Please refer to the <abbr title="' . dirname(__FILE__) . '/README.md">README</abbr> on how to install Yii.</p>'; |
|
| 19 | + echo '<p>You need to install Yii framework via composer or adjust the framework path in file <abbr title="'.__FILE__.'">'.basename(__FILE__).'</abbr>.</p>'; |
|
| 20 | + echo '<p>Please refer to the <abbr title="'.dirname(__FILE__).'/README.md">README</abbr> on how to install Yii.</p>'; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | -require_once($frameworkPath . '/requirements/YiiRequirementChecker.php'); |
|
| 23 | +require_once($frameworkPath.'/requirements/YiiRequirementChecker.php'); |
|
| 24 | 24 | $requirementsChecker = new YiiRequirementChecker(); |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | 'phpSmtp' => array( |
| 103 | 103 | 'name' => 'PHP mail SMTP', |
| 104 | 104 | 'mandatory' => false, |
| 105 | - 'condition' => strlen(ini_get('SMTP'))>0, |
|
| 105 | + 'condition' => strlen(ini_get('SMTP')) > 0, |
|
| 106 | 106 | 'by' => 'Email sending', |
| 107 | 107 | 'memo' => 'PHP mail SMTP server required', |
| 108 | 108 | ), |
@@ -10,13 +10,13 @@ |
||
| 10 | 10 | defined('YII_DEBUG') or define('YII_DEBUG', true); |
| 11 | 11 | defined('YII_ENV') or define('YII_ENV', 'test'); |
| 12 | 12 | |
| 13 | -require(__DIR__ . '/../vendor/autoload.php'); |
|
| 14 | -require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); |
|
| 13 | +require(__DIR__.'/../vendor/autoload.php'); |
|
| 14 | +require(__DIR__.'/../vendor/yiisoft/yii2/Yii.php'); |
|
| 15 | 15 | |
| 16 | 16 | include '../c3.php'; |
| 17 | 17 | |
| 18 | 18 | define('MY_APP_STARTED', true); |
| 19 | 19 | |
| 20 | -$config = require(__DIR__ . '/../tests/codeception/config/acceptance.php'); |
|
| 20 | +$config = require(__DIR__.'/../tests/codeception/config/acceptance.php'); |
|
| 21 | 21 | |
| 22 | 22 | (new yii\web\Application($config))->run(); |
@@ -3,14 +3,14 @@ |
||
| 3 | 3 | defined('YII_DEBUG') or define('YII_DEBUG', true); |
| 4 | 4 | defined('YII_ENV') or define('YII_ENV', 'dev'); |
| 5 | 5 | |
| 6 | -require(__DIR__ . '/../vendor/autoload.php'); |
|
| 7 | -require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); |
|
| 6 | +require(__DIR__.'/../vendor/autoload.php'); |
|
| 7 | +require(__DIR__.'/../vendor/yiisoft/yii2/Yii.php'); |
|
| 8 | 8 | |
| 9 | 9 | $config = yii\helpers\ArrayHelper::merge( |
| 10 | - require(__DIR__ . '/../config/main.php'), |
|
| 11 | - require(__DIR__ . '/../config/main.local.php'), |
|
| 12 | - require(__DIR__ . '/../config/common.php'), |
|
| 13 | - require(__DIR__ . '/../config/common.local.php') |
|
| 10 | + require(__DIR__.'/../config/main.php'), |
|
| 11 | + require(__DIR__.'/../config/main.local.php'), |
|
| 12 | + require(__DIR__.'/../config/common.php'), |
|
| 13 | + require(__DIR__.'/../config/common.local.php') |
|
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | 16 | (new yii\web\Application($config))->run(); |
@@ -53,17 +53,17 @@ |
||
| 53 | 53 | |
| 54 | 54 | $session = \Yii::$app->getSession(); |
| 55 | 55 | $flashes = $session->getAllFlashes(); |
| 56 | - $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : ''; |
|
| 56 | + $appendCss = isset($this->options['class']) ? ' '.$this->options['class'] : ''; |
|
| 57 | 57 | |
| 58 | 58 | foreach ($flashes as $type => $data) { |
| 59 | 59 | if (isset($this->alertTypes[$type])) { |
| 60 | 60 | $data = (array) $data; |
| 61 | 61 | foreach ($data as $message) { |
| 62 | 62 | /* initialize css class for each alert box */ |
| 63 | - $this->options['class'] = $this->alertTypes[$type] . $appendCss; |
|
| 63 | + $this->options['class'] = $this->alertTypes[$type].$appendCss; |
|
| 64 | 64 | |
| 65 | 65 | /* assign unique id to each alert box */ |
| 66 | - $this->options['id'] = $this->getId() . '-' . $type; |
|
| 66 | + $this->options['id'] = $this->getId().'-'.$type; |
|
| 67 | 67 | |
| 68 | 68 | echo \yii\bootstrap\Alert::widget([ |
| 69 | 69 | 'body' => $message, |