Skip to content

Commit

Permalink
php-cs-fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Feb 18, 2016
1 parent fd7da57 commit 3b565c7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ return Symfony\CS\Config\Config::create()
'-phpdoc_params', /// All items of the @param, @throws, @return, @var, and @type phpdoc tags must be aligned vertically.
'-phpdoc_scalar', /// Scalar types should always be written in the same form. "int", not "integer"; "bool", not "boolean".
'-phpdoc_separation', /// Annotations of a different type are separated by a single blank line.
'-phpdoc_to_comment', /// Docblocks should only be used on structural elements
'header_comment', /// Add, replace or remove header comment.
'concat_with_spaces', /// Concatenation should be used with at least one whitespace around.
'ereg_to_preg', /// Replace deprecated ereg regular expression functions with preg. Warning! This could change code behavior.
Expand Down
32 changes: 16 additions & 16 deletions src/controllers/DomainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/hipanel-module-domain
* @package hipanel-module-domain
* @license BSD-3-Clause
* @copyright Copyright (c) 2014-2015, HiQDev (http://hiqdev.com/)
* @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
*/

/**
Expand All @@ -15,6 +15,7 @@
* @license http://hiqdev.com/hipanel-module-domain/license
* @copyright Copyright (c) 2015 HiQDev
*/

namespace hipanel\modules\domain\controllers;

use hipanel\actions\Action;
Expand Down Expand Up @@ -106,7 +107,7 @@ public function actions()
},
'validatedInputId' => function ($action, $model, $id, $attribute, $errors) {
return 'domain-' . $attribute;
}
},
],
'bulk-set-contacts' => [
'class' => SmartPerformAction::class,
Expand Down Expand Up @@ -164,7 +165,7 @@ public function actions()
'state' => 'domain.domain.state',
'client_id' => 'client.client.id',
'seller_id' => 'client.client.seller_id',
]
],
],
'view' => [
'class' => ViewAction::class,
Expand Down Expand Up @@ -192,12 +193,12 @@ public function actions()
$request = Yii::$app->request;
$action->collection->load([[
'pincode' => $request->post('pincode'),
'receiver' => $request->post('receiver')
'receiver' => $request->post('receiver'),
]]);
},
'validatedInputId' => function ($action, $model, $id, $attribute, $errors) {
return 'push-' . $attribute;
}
},
],
'set-note' => [
'class' => SmartUpdateAction::class,
Expand All @@ -206,7 +207,7 @@ public function actions()
'POST html' => [
'save' => true,
'success' => [
'class' => RedirectAction::class
'class' => RedirectAction::class,
],
],
'on beforeSave' => function (Event $event) {
Expand All @@ -223,7 +224,7 @@ public function actions()
'bulk-set-note' => [
'class' => PrepareBulkAction::class,
'scenario' => 'set-note',
'view' => '_bulkSetNote'
'view' => '_bulkSetNote',
],
'set-nss' => [
'class' => SmartUpdateAction::class,
Expand All @@ -234,7 +235,7 @@ public function actions()
'class' => RedirectAction::class,
'url' => function ($action) {
return $action->controller->redirect(Yii::$app->request->referrer);
}
},
],
],
],
Expand All @@ -249,7 +250,7 @@ public function actions()
'class' => ProxyAction::class,
'return' => function ($action) {
return ['fuck' => 'yeah'];
}
},
],
],
'on beforeFetch' => function (Event $event) {
Expand Down Expand Up @@ -528,7 +529,7 @@ public function actionCheck()
return [];
};
$fqdn = Yii::$app->request->post('domain');
list ($domain, $zone) = explode('.', $fqdn, 2);
list($domain, $zone) = explode('.', $fqdn, 2);
$line = [
'fqdn' => $fqdn,
'domain' => $domain,
Expand Down Expand Up @@ -565,10 +566,9 @@ public function actionCheck()

/**
* Returns the tariff for the domain operations
* Caches the API request for 3600 seconds and depends on client id and seller login
*
* @return Tariff
* Caches the API request for 3600 seconds and depends on client id and seller login.
* @throws \yii\base\InvalidConfigException
* @return Tariff
*/
protected function getDomainTariff()
{
Expand Down Expand Up @@ -618,12 +618,12 @@ public function actionCheckDomain()
foreach ($zones as $resource) {
$dropDownZones[$resource->zone] = '.' . $resource->zone;
}
uasort($dropDownZones, function($a, $b) { return $a === '.com' ? 0 : 1; });
uasort($dropDownZones, function ($a, $b) { return $a === '.com' ? 0 : 1; });
if ($model->load(Yii::$app->request->get()) && !empty($dropDownZones)) {
// Check if domain already have zone
if (strpos($model->domain, '.') !== false) {
list($domain, $zone) = explode('.', $model->domain, 2);
if (!in_array('.' . $zone, $dropDownZones)) {
if (!in_array('.' . $zone, $dropDownZones, true)) {
$zone = 'com';
}
$model->zone = $zone;
Expand All @@ -650,7 +650,7 @@ public function actionCheckDomain()
return $this->render('checkDomain', [
'model' => $model,
'dropDownZonesOptions' => $dropDownZones,
'results' => $results
'results' => $results,
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/domain/checkDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function concatValues(obj) {
'inputOptions' => [
'value' => $model->zone !== null ? $model->zone : $model::DEFAULT_ZONE,
'class' => 'form-control input-lg',
]
],
]); ?>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/NsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private function createNsModels($nss)
$ns_ip = explode('/', $item);
$data['Ns'] = [
'name' => $ns_ip[0],
'ip' => explode(';', $ns_ip[1])
'ip' => explode(';', $ns_ip[1]),
];
} else {
$data['Ns']['name'] = $item;
Expand Down
12 changes: 6 additions & 6 deletions src/widgets/views/ns.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<div class="col-md-5">
<?= $form->field($nsModel, "[$i]name")->textInput([
'placeholder' => $nsModel->getAttributeLabel('name'),
'data-attribute' => 'name'
'data-attribute' => 'name',
])->label(false) ?>
</div>
<div class="col-md-5">
Expand All @@ -130,21 +130,21 @@
'disabled' => !StringHelper::endsWith($nsModel->name, $model->domain),
'placeholder' => $nsModel->getAttributeLabel('ip'),
'data-attribute' => 'ip',
'value' => implode(',', (array) $nsModel->ip)
'value' => implode(',', (array) $nsModel->ip),
],
'pluginOptions' => [
'select2Options' => [
'tags' => [],
'multiple' => true,
'tokenSeparator' => [';', ',', ' '],
'minimumResultsForSearch' => -1,
'createSearchChoice' => new \yii\web\JsExpression("
'createSearchChoice' => new \yii\web\JsExpression('
function(term, data) {
return {id:term, text:term};
}
")
]
]
'),
],
],
])->label(false) ?>
<?php endif; ?>
</div>
Expand Down

0 comments on commit 3b565c7

Please sign in to comment.