Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
Signed-off-by: AIZAWA Hina <hina@bouhime.com>
  • Loading branch information
fetus-hina committed Apr 12, 2016
1 parent b8875c2 commit 1b44933
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ node_modules: package.json
npm install

check-style: vendor
vendor/bin/phpcs --standard=PSR2 --encoding=UTF-8 --runtime-set ignore_warnings_on_exit 1 $(STYLE_TARGETS)
vendor/bin/phpcs --standard=phpcs-customize.xml --encoding=UTF-8 --runtime-set ignore_warnings_on_exit 1 $(STYLE_TARGETS)
vendor/bin/check-author.php --php-files $(STYLE_TARGETS)

fix-style: vendor
Expand Down
14 changes: 12 additions & 2 deletions actions/show/UserStatReportAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ protected function runYear($form)
throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'));
$from = mktime(0, 0, 0, 1, 1, (int)$form->year);
$to = mktime(0, 0, -1, 1, 1, (int)$form->year + 1);
$list = $this->query(date('Y-m-d\TH:i:sP', $from), date('Y-m-d\TH:i:sP', $to), "TO_CHAR({{battle}}.[[at]], 'YYYY-MM')");
$list = $this->query(
date('Y-m-d\TH:i:sP', $from),
date('Y-m-d\TH:i:sP', $to),
"TO_CHAR({{battle}}.[[at]], 'YYYY-MM')"
);
}

private function query($from, $to, $date)
Expand Down Expand Up @@ -134,7 +138,13 @@ private function query($from, $to, $date)
['<>', '{{lobby}}.[[key]]', 'private'],
['between', '{{battle}}.[[at]]', $from, $to],
])
->groupBy([$date, '{{battle}}.[[lobby_id]]', '{{battle}}.[[rule_id]]', '{{battle}}.[[map_id]]', '{{battle}}.[[weapon_id]]']);
->groupBy([
$date,
'{{battle}}.[[lobby_id]]',
'{{battle}}.[[rule_id]]',
'{{battle}}.[[map_id]]',
'{{battle}}.[[weapon_id]]',
]);
$list = array_map(
function ($row) {
$row['lobby_name'] = Yii::t('app-rule', $row['lobby_name']);
Expand Down
10 changes: 8 additions & 2 deletions components/widgets/BattleFilterWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,16 @@ protected function drawTermPeriod(ActiveForm $form)
'div',
implode('', [
$form->field($this->filter, 'term_from', [
'inputTemplate' => Yii::t('app', '<div class="input-group"><span class="input-group-addon">From:</span>{input}</div>'),
'inputTemplate' => Yii::t(
'app',
'<div class="input-group"><span class="input-group-addon">From:</span>{input}</div>'
),
])->input('text', ['placeholder' => 'YYYY-MM-DD hh:mm:ss'])->label(false),
$form->field($this->filter, 'term_to', [
'inputTemplate' => Yii::t('app', '<div class="input-group"><span class="input-group-addon">To:</span>{input}</div>'),
'inputTemplate' => Yii::t(
'app',
'<div class="input-group"><span class="input-group-addon">To:</span>{input}</div>'
),
])->input('text', ['placeholder' => 'YYYY-MM-DD hh:mm:ss'])->label(false),
]),
[ 'id' => $divId ]
Expand Down
4 changes: 3 additions & 1 deletion models/StatAgentUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function rules()
[['date'], 'safe'],
[['battle_count', 'user_count'], 'integer'],
[['agent'], 'string', 'max' => 64],
[['agent', 'date'], 'unique', 'targetAttribute' => ['agent', 'date'], 'message' => 'The combination of Agent and Date has already been taken.']
[['agent', 'date'], 'unique',
'targetAttribute' => ['agent', 'date'],
'message' => 'The combination of Agent and Date has already been taken.']
];
}

Expand Down
5 changes: 5 additions & 0 deletions models/WeaponAttack.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* @copyright Copyright (C) 2015-2016 AIZAWA Hina
* @license https://github.com/fetus-hina/stat.ink/blob/master/LICENSE MIT
* @author AIZAWA Hina <hina@bouhime.com>
*/

namespace app\models;

Expand Down
8 changes: 8 additions & 0 deletions phpcs-customize.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" ?>
<ruleset name="Customized-PSR2">
<description>A custom coding standard</description>
<rule ref="PSR2">
<!-- 本当は components/ability/effect/* に限定したい -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
</rule>
</ruleset>

0 comments on commit 1b44933

Please sign in to comment.