CS fixes.

This commit is contained in:
resurtm
2013-06-07 22:41:11 +06:00
parent d48ef4198e
commit 7a7d2a9c06
57 changed files with 1611 additions and 1640 deletions

View File

@ -12,7 +12,6 @@ use DateTime;
use yii\helpers\HtmlPurifier; use yii\helpers\HtmlPurifier;
use yii\helpers\Html; use yii\helpers\Html;
/** /**
* Formatter provides a set of commonly used data formatting methods. * Formatter provides a set of commonly used data formatting methods.
* *

View File

@ -23,4 +23,3 @@ class InvalidCallException extends Exception
return \Yii::t('yii', 'Invalid Call'); return \Yii::t('yii', 'Invalid Call');
} }
} }

View File

@ -23,4 +23,3 @@ class InvalidConfigException extends Exception
return \Yii::t('yii', 'Invalid Configuration'); return \Yii::t('yii', 'Invalid Configuration');
} }
} }

View File

@ -23,4 +23,3 @@ class InvalidParamException extends Exception
return \Yii::t('yii', 'Invalid Parameter'); return \Yii::t('yii', 'Invalid Parameter');
} }
} }

View File

@ -23,4 +23,3 @@ class InvalidRouteException extends UserException
return \Yii::t('yii', 'Invalid Route'); return \Yii::t('yii', 'Invalid Route');
} }
} }

View File

@ -18,5 +18,5 @@ interface Jsonable
/** /**
* @return string the JSON representation of this object * @return string the JSON representation of this object
*/ */
function toJson(); public function toJson();
} }

View File

@ -23,4 +23,3 @@ class NotSupportedException extends Exception
return \Yii::t('yii', 'Not Supported'); return \Yii::t('yii', 'Not Supported');
} }
} }

View File

@ -23,4 +23,3 @@ class UnknownClassException extends Exception
return \Yii::t('yii', 'Unknown Class'); return \Yii::t('yii', 'Unknown Class');
} }
} }

View File

@ -23,4 +23,3 @@ class UnknownMethodException extends Exception
return \Yii::t('yii', 'Unknown Method'); return \Yii::t('yii', 'Unknown Method');
} }
} }

View File

@ -23,4 +23,3 @@ class UnknownPropertyException extends Exception
return \Yii::t('yii', 'Unknown Property'); return \Yii::t('yii', 'Unknown Property');
} }
} }

View File

@ -6,9 +6,8 @@
*/ */
namespace yii\bootstrap; namespace yii\bootstrap;
use yii\base\InvalidConfigException;
use yii\helpers\Html;
use yii\helpers\Html;
/** /**
* Button renders a bootstrap button. * Button renders a bootstrap button.

View File

@ -6,8 +6,8 @@
*/ */
namespace yii\bootstrap; namespace yii\bootstrap;
use yii\helpers\Html;
use yii\helpers\Html;
/** /**
* ButtonDropdown renders a group or split button dropdown bootstrap component. * ButtonDropdown renders a group or split button dropdown bootstrap component.

View File

@ -10,7 +10,6 @@ namespace yii\bootstrap;
use yii\helpers\base\ArrayHelper; use yii\helpers\base\ArrayHelper;
use yii\helpers\Html; use yii\helpers\Html;
/** /**
* ButtonGroup renders a button group bootstrap component. * ButtonGroup renders a button group bootstrap component.
* *

View File

@ -11,7 +11,6 @@ use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
use yii\helpers\Html; use yii\helpers\Html;
/** /**
* Dropdown renders a Bootstrap dropdown menu component. * Dropdown renders a Bootstrap dropdown menu component.
* *

View File

@ -11,7 +11,6 @@ use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
use yii\helpers\Html; use yii\helpers\Html;
/** /**
* Progress renders a bootstrap progress bar component. * Progress renders a bootstrap progress bar component.
* *

View File

@ -11,7 +11,6 @@ use Yii;
use yii\base\View; use yii\base\View;
use yii\helpers\Json; use yii\helpers\Json;
/** /**
* \yii\bootstrap\Widget is the base class for all bootstrap widgets. * \yii\bootstrap\Widget is the base class for all bootstrap widgets.
* *

View File

@ -86,4 +86,3 @@ class XCache extends Cache
return true; return true;
} }
} }

View File

@ -25,4 +25,3 @@ class Exception extends UserException
return \Yii::t('yii', 'Error'); return \Yii::t('yii', 'Error');
} }
} }

View File

@ -220,7 +220,8 @@ class AssetController extends Controller
* @param array $result already loaded bundles list. * @param array $result already loaded bundles list.
* @throws \yii\console\Exception on failure. * @throws \yii\console\Exception on failure.
*/ */
protected function loadBundleDependency($name, $bundle, &$result) { protected function loadBundleDependency($name, $bundle, &$result)
{
if (!empty($bundle->depends)) { if (!empty($bundle->depends)) {
$assetManager = $this->getAssetManager(); $assetManager = $this->getAssetManager();
foreach ($bundle->depends as $dependencyName) { foreach ($bundle->depends as $dependencyName) {

View File

@ -179,8 +179,7 @@ class MessageController extends Controller
} }
ksort($translated); ksort($translated);
foreach ($translated as $message => $translation) { foreach ($translated as $message => $translation) {
if (!isset($merged[$message]) && !isset($todo[$message]) && !$removeOld) if (!isset($merged[$message]) && !isset($todo[$message]) && !$removeOld) {
{
if (substr($translation, 0, 2) === '@@' && substr($translation, -2) === '@@') { if (substr($translation, 0, 2) === '@@' && substr($translation, -2) === '@@') {
$todo[$message]=$translation; $todo[$message]=$translation;
} else { } else {

View File

@ -305,8 +305,7 @@ class Connection extends Component
$this->pdo = $this->createPdoInstance(); $this->pdo = $this->createPdoInstance();
$this->initConnection(); $this->initConnection();
Yii::endProfile($token, __METHOD__); Yii::endProfile($token, __METHOD__);
} } catch (\PDOException $e) {
catch (\PDOException $e) {
Yii::endProfile($token, __METHOD__); Yii::endProfile($token, __METHOD__);
Yii::error("Failed to open DB connection ({$this->dsn}): " . $e->getMessage(), __METHOD__); Yii::error("Failed to open DB connection ({$this->dsn}): " . $e->getMessage(), __METHOD__);
$message = YII_DEBUG ? 'Failed to open DB connection: ' . $e->getMessage() : 'Failed to open DB connection.'; $message = YII_DEBUG ? 'Failed to open DB connection: ' . $e->getMessage() : 'Failed to open DB connection.';

View File

@ -14,5 +14,4 @@ namespace yii\helpers;
*/ */
class Json extends base\Json class Json extends base\Json
{ {
} }

View File

@ -593,7 +593,6 @@ class Console
return $size = array((int)preg_replace('~[^0-9]~', '', $output[3]), (int)preg_replace('~[^0-9]~', '', $output[4])); return $size = array((int)preg_replace('~[^0-9]~', '', $output[3]), (int)preg_replace('~[^0-9]~', '', $output[4]));
} }
} else { } else {
// try stty if available // try stty if available
$stty = array(); $stty = array();
if (exec('stty -a 2>&1', $stty) && preg_match('/rows\s+(\d+);\s*columns\s+(\d+);/mi', implode(' ', $stty), $matches)) { if (exec('stty -a 2>&1', $stty) && preg_match('/rows\s+(\d+);\s*columns\s+(\d+);/mi', implode(' ', $stty), $matches)) {

View File

@ -1479,5 +1479,4 @@ class Html
$name = strtolower(static::getInputName($model, $attribute)); $name = strtolower(static::getInputName($model, $attribute));
return str_replace(array('[]', '][', '[', ']', ' '), array('', '-', '-', '', '-'), $name); return str_replace(array('[]', '][', '[', ']', ' '), array('', '-', '-', '', '-'), $name);
} }
} }

View File

@ -468,7 +468,7 @@ class Inflector
if (in_array(($number % 100), range(11, 13))) { if (in_array(($number % 100), range(11, 13))) {
return $number . 'th'; return $number . 'th';
} }
switch (($number % 10)) { switch ($number % 10) {
case 1: return $number . 'st'; case 1: return $number . 'st';
case 2: return $number . 'nd'; case 2: return $number . 'nd';
case 3: return $number . 'rd'; case 3: return $number . 'rd';

View File

@ -118,4 +118,3 @@ class MessageSource extends Component
} }
} }
} }

View File

@ -125,7 +125,7 @@ class Accordion extends Widget
$items[] = Html::tag($headerTag, $item['header'], $headerOptions); $items[] = Html::tag($headerTag, $item['header'], $headerOptions);
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', array())); $options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', array()));
$tag = ArrayHelper::remove($options, 'tag', 'div'); $tag = ArrayHelper::remove($options, 'tag', 'div');
$items[] = Html::tag($tag, $item['content'], $options);; $items[] = Html::tag($tag, $item['content'], $options);
} }
return implode("\n", $items); return implode("\n", $items);

View File

@ -10,7 +10,6 @@ namespace yii\jui;
use Yii; use Yii;
use yii\helpers\Json; use yii\helpers\Json;
/** /**
* Menu renders a menu jQuery UI widget. * Menu renders a menu jQuery UI widget.
* *

View File

@ -10,7 +10,6 @@ namespace yii\jui;
use Yii; use Yii;
use yii\helpers\Json; use yii\helpers\Json;
/** /**
* \yii\jui\Widget is the base class for all jQuery UI widgets. * \yii\jui\Widget is the base class for all jQuery UI widgets.
* *

View File

@ -493,9 +493,10 @@ class DbManager extends Manager
'bizRule' => $row['biz_rule'], 'bizRule' => $row['biz_rule'],
'data' => $data, 'data' => $data,
)); ));
} else } else {
return null; return null;
} }
}
/** /**
* Saves an authorization item to persistent storage. * Saves an authorization item to persistent storage.

View File

@ -117,4 +117,3 @@ class CaptchaValidator extends Validator
return 'yii.validation.captcha(value, messages, ' . json_encode($options) . ');'; return 'yii.validation.captcha(value, messages, ' . json_encode($options) . ');';
} }
} }

View File

@ -73,4 +73,3 @@ class DateValidator extends Validator
return DateTime::createFromFormat($this->format, $value) !== false; return DateTime::createFromFormat($this->format, $value) !== false;
} }
} }

View File

@ -40,4 +40,3 @@ class DefaultValueValidator extends Validator
} }
} }
} }

View File

@ -99,4 +99,3 @@ class ExistValidator extends Validator
return $query->exists(); return $query->exists();
} }
} }

View File

@ -6,6 +6,7 @@
*/ */
namespace yii\validators; namespace yii\validators;
use yii\base\InvalidConfigException; use yii\base\InvalidConfigException;
/** /**

View File

@ -174,4 +174,3 @@ class StringValidator extends Validator
return 'yii.validation.string(value, messages, ' . json_encode($options) . ');'; return 'yii.validation.string(value, messages, ' . json_encode($options) . ');';
} }
} }

View File

@ -11,7 +11,6 @@ use Yii;
use yii\base\Object; use yii\base\Object;
use ArrayIterator; use ArrayIterator;
/** /**
* HeaderCollection is used by [[Response]] to maintain the currently registered HTTP headers. * HeaderCollection is used by [[Response]] to maintain the currently registered HTTP headers.
* *

View File

@ -792,4 +792,3 @@ class Request extends \yii\base\Request
} }
} }
} }

View File

@ -91,5 +91,4 @@ class ListPager extends Widget
'{page}' => $page + 1, '{page}' => $page + 1,
)); ));
} }
} }