diff --git a/config/console.php b/config/console.php
index 8d50bd2..cc1cdb8 100644
--- a/config/console.php
+++ b/config/console.php
@@ -3,7 +3,7 @@ $params = require(__DIR__ . '/params.php');
return [
'id' => 'bootstrap-console',
'basePath' => dirname(__DIR__),
- 'preload' => array('log'),
+ 'preload' => ['log'],
'controllerPath' => dirname(__DIR__) . '/commands',
'controllerNamespace' => 'app\commands',
'modules' => [
diff --git a/requirements.php b/requirements.php
index c9e6493..139284f 100644
--- a/requirements.php
+++ b/requirements.php
@@ -26,78 +26,78 @@ $requirementsChecker = new YiiRequirementChecker();
/**
* Adjust requirements according to your application specifics.
*/
-$requirements = array(
+$requirements = [
// Database :
- array(
+ [
'name' => 'PDO extension',
'mandatory' => true,
'condition' => extension_loaded('pdo'),
'by' => 'All DB-related classes',
- ),
- array(
+ ],
+ [
'name' => 'PDO SQLite extension',
'mandatory' => false,
'condition' => extension_loaded('pdo_sqlite'),
'by' => 'All DB-related classes',
'memo' => 'Required for SQLite database.',
- ),
- array(
+ ],
+ [
'name' => 'PDO MySQL extension',
'mandatory' => false,
'condition' => extension_loaded('pdo_mysql'),
'by' => 'All DB-related classes',
'memo' => 'Required for MySQL database.',
- ),
+ ],
// Cache :
- array(
+ [
'name' => 'Memcache extension',
'mandatory' => false,
'condition' => extension_loaded('memcache') || extension_loaded('memcached'),
'by' => 'CMemCache',
'memo' => extension_loaded('memcached') ? 'To use memcached set CMemCache::useMemcached to true
.' : ''
- ),
- array(
+ ],
+ [
'name' => 'APC extension',
'mandatory' => false,
'condition' => extension_loaded('apc') || extension_loaded('apc'),
'by' => 'CApcCache',
- ),
+ ],
// Additional PHP extensions :
- array(
+ [
'name' => 'Mcrypt extension',
'mandatory' => false,
'condition' => extension_loaded('mcrypt'),
'by' => 'CSecurityManager',
'memo' => 'Required by encrypt and decrypt methods.'
- ),
+ ],
// PHP ini :
- 'phpSafeMode' => array(
+ 'phpSafeMode' => [
'name' => 'PHP safe mode',
'mandatory' => false,
'condition' => $requirementsChecker->checkPhpIniOff("safe_mode"),
'by' => 'File uploading and console command execution',
'memo' => '"safe_mode" should be disabled at php.ini',
- ),
- 'phpExposePhp' => array(
+ ],
+ 'phpExposePhp' => [
'name' => 'Expose PHP',
'mandatory' => false,
'condition' => $requirementsChecker->checkPhpIniOff("expose_php"),
'by' => 'Security reasons',
'memo' => '"expose_php" should be disabled at php.ini',
- ),
- 'phpAllowUrlInclude' => array(
+ ],
+ 'phpAllowUrlInclude' => [
'name' => 'PHP allow url include',
'mandatory' => false,
'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"),
'by' => 'Security reasons',
'memo' => '"allow_url_include" should be disabled at php.ini',
- ),
- 'phpSmtp' => array(
+ ],
+ 'phpSmtp' => [
'name' => 'PHP mail SMTP',
'mandatory' => false,
'condition' => strlen(ini_get('SMTP'))>0,
'by' => 'Email sending',
'memo' => 'PHP mail SMTP server required',
- ),
-);
+ ],
+];
$requirementsChecker->checkYii()->check($requirements)->render();
diff --git a/tests/acceptance/ContactCept.php b/tests/acceptance/ContactCept.php
index 73527ab..5ec5641 100644
--- a/tests/acceptance/ContactCept.php
+++ b/tests/acceptance/ContactCept.php
@@ -4,7 +4,7 @@ $I->wantTo('ensure that contact works');
$I->amOnPage('?r=site/contact');
$I->see('Contact', 'h1');
-$I->submitForm('#contact-form', array());
+$I->submitForm('#contact-form', []);
$I->see('Contact', 'h1');
$I->see('Name cannot be blank');
$I->see('Email cannot be blank');
@@ -12,25 +12,25 @@ $I->see('Subject cannot be blank');
$I->see('Body cannot be blank');
$I->see('The verification code is incorrect');
-$I->submitForm('#contact-form', array(
+$I->submitForm('#contact-form', [
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester.email',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
-));
+]);
$I->dontSee('Name cannot be blank', '.help-inline');
$I->see('Email is not a valid email address.');
$I->dontSee('Subject cannot be blank', '.help-inline');
$I->dontSee('Body cannot be blank', '.help-inline');
$I->dontSee('The verification code is incorrect', '.help-inline');
-$I->submitForm('#contact-form', array(
+$I->submitForm('#contact-form', [
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester@example.com',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
-));
+]);
$I->dontSeeElement('#contact-form');
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
diff --git a/tests/acceptance/LoginCept.php b/tests/acceptance/LoginCept.php
index 77c4a07..5621b15 100644
--- a/tests/acceptance/LoginCept.php
+++ b/tests/acceptance/LoginCept.php
@@ -4,20 +4,20 @@ $I->wantTo('ensure that login works');
$I->amOnPage('?r=site/login');
$I->see('Login', 'h1');
-$I->submitForm('#login-form', array());
+$I->submitForm('#login-form', []);
$I->dontSee('Logout (admin)');
$I->see('Username cannot be blank');
$I->see('Password cannot be blank');
-$I->submitForm('#login-form', array(
+$I->submitForm('#login-form', [
'LoginForm[username]' => 'admin',
'LoginForm[password]' => 'wrong',
-));
+]);
$I->dontSee('Logout (admin)');
$I->see('Incorrect username or password');
-$I->submitForm('#login-form', array(
+$I->submitForm('#login-form', [
'LoginForm[username]' => 'admin',
'LoginForm[password]' => 'admin',
-));
+]);
$I->see('Logout (admin)');
diff --git a/tests/functional/ContactCept.php b/tests/functional/ContactCept.php
index 6feafd9..b58361a 100644
--- a/tests/functional/ContactCept.php
+++ b/tests/functional/ContactCept.php
@@ -4,7 +4,7 @@ $I->wantTo('ensure that contact works');
$I->amOnPage('?r=site/contact');
$I->see('Contact', 'h1');
-$I->submitForm('#contact-form', array());
+$I->submitForm('#contact-form', []);
$I->see('Contact', 'h1');
$I->see('Name cannot be blank');
$I->see('Email cannot be blank');
@@ -12,25 +12,25 @@ $I->see('Subject cannot be blank');
$I->see('Body cannot be blank');
$I->see('The verification code is incorrect');
-$I->submitForm('#contact-form', array(
+$I->submitForm('#contact-form', [
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester.email',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
-));
+]);
$I->dontSee('Name cannot be blank', '.help-inline');
$I->see('Email is not a valid email address.');
$I->dontSee('Subject cannot be blank', '.help-inline');
$I->dontSee('Body cannot be blank', '.help-inline');
$I->dontSee('The verification code is incorrect', '.help-inline');
-$I->submitForm('#contact-form', array(
+$I->submitForm('#contact-form', [
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester@example.com',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
-));
+]);
$I->dontSeeElement('#contact-form');
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
diff --git a/tests/functional/LoginCept.php b/tests/functional/LoginCept.php
index 11f8f6b..9d71378 100644
--- a/tests/functional/LoginCept.php
+++ b/tests/functional/LoginCept.php
@@ -4,20 +4,20 @@ $I->wantTo('ensure that login works');
$I->amOnPage('?r=site/login');
$I->see('Login', 'h1');
-$I->submitForm('#login-form', array());
+$I->submitForm('#login-form', []);
$I->dontSee('Logout (admin)');
$I->see('Username cannot be blank');
$I->see('Password cannot be blank');
-$I->submitForm('#login-form', array(
+$I->submitForm('#login-form', [
'LoginForm[username]' => 'admin',
'LoginForm[password]' => 'wrong',
-));
+]);
$I->dontSee('Logout (admin)');
$I->see('Incorrect username or password');
-$I->submitForm('#login-form', array(
+$I->submitForm('#login-form', [
'LoginForm[username]' => 'admin',
'LoginForm[password]' => 'admin',
-));
+]);
$I->see('Logout (admin)');
diff --git a/views/layouts/main.php b/views/layouts/main.php
index 1b7083d..30246b1 100644
--- a/views/layouts/main.php
+++ b/views/layouts/main.php
@@ -21,33 +21,33 @@ app\config\AppAsset::register($this);
Please fill out the following fields to login:
- 'login-form', - 'options' => array('class' => 'form-horizontal'), - 'fieldConfig' => array( + 'options' => ['class' => 'form-horizontal'], + 'fieldConfig' => [ 'template' => "{label}\n