mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
various code style and whitespace adjustments
This commit is contained in:
@ -29,3 +29,4 @@ namespace yii\base;
|
||||
interface Configurable
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ use Yii;
|
||||
*/
|
||||
class ErrorException extends \ErrorException
|
||||
{
|
||||
|
||||
/**
|
||||
* Zend runtime won't call the error handler on fatals, HHVM will, with an error code of 16777217
|
||||
* We will handle fatal error a bit different on HHVM.
|
||||
@ -25,6 +24,7 @@ class ErrorException extends \ErrorException
|
||||
*/
|
||||
const E_HHVM_FATAL_ERROR = 16777217; // E_ERROR | (1 << 24)
|
||||
|
||||
|
||||
/**
|
||||
* Constructs the exception.
|
||||
* @link http://php.net/manual/en/errorexception.construct.php
|
||||
|
||||
@ -44,12 +44,12 @@ abstract class ErrorHandler extends Component
|
||||
* @var string Used to reserve memory for fatal error handler.
|
||||
*/
|
||||
private $_memoryReserve;
|
||||
|
||||
/**
|
||||
* @var \Exception from HHVM error that stores backtrace
|
||||
*/
|
||||
private $_hhvmException;
|
||||
|
||||
|
||||
/**
|
||||
* Register this error handler
|
||||
*/
|
||||
|
||||
@ -16,10 +16,10 @@ namespace yii\base;
|
||||
class InvalidValueException extends \UnexpectedValueException
|
||||
{
|
||||
/**
|
||||
* @return string the user-friendly name of this exception
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'Invalid Return Value';
|
||||
}
|
||||
* @return string the user-friendly name of this exception
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'Invalid Return Value';
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess, Arrayab
|
||||
* ~~~
|
||||
*
|
||||
* In the above `$attribute` refers to the attribute currently being validated while `$params` contains an array of
|
||||
* validator configuration options such as `max` in case of `string` validator. The value of the attribute currently being validated
|
||||
* validator configuration options such as `max` in case of `string` validator. The value of the attribute currently being validated
|
||||
* can be accessed as `$this->$attribute`. Note the `$` before `attribute`; this is taking the value of the variable
|
||||
* `$attribute` and using it as the name of the property to access.
|
||||
*
|
||||
|
||||
@ -87,6 +87,7 @@ class Security extends Component
|
||||
*/
|
||||
public $passwordHashCost = 13;
|
||||
|
||||
|
||||
/**
|
||||
* Encrypts data using a password.
|
||||
* Derives keys for encryption and authentication from the password using PBKDF2 and a random salt,
|
||||
|
||||
@ -81,6 +81,7 @@ class Theme extends Component
|
||||
|
||||
private $_baseUrl;
|
||||
|
||||
|
||||
/**
|
||||
* @return string the base URL (without ending slash) for this theme. All resources of this theme are considered
|
||||
* to be under this base URL.
|
||||
|
||||
@ -75,6 +75,7 @@ class Application extends \yii\base\Application
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
||||
@ -60,7 +60,7 @@ class CacheController extends Controller
|
||||
* # flushes caches specified by their id: "first", "second", "third"
|
||||
* yii cache/flush first second third
|
||||
* ~~~
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function actionFlush()
|
||||
{
|
||||
@ -202,7 +202,7 @@ class CacheController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param array $caches
|
||||
*/
|
||||
private function notifyFlushed($caches)
|
||||
|
||||
@ -376,7 +376,7 @@ class FixtureController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds fixtures to be loaded, for example "User", if no fixtures were specified then all of them
|
||||
* Finds fixtures to be loaded, for example "User", if no fixtures were specified then all of them
|
||||
* will be searching by suffix "Fixture.php".
|
||||
* @param array $fixtures fixtures to be loaded
|
||||
* @return array Array of found fixtures. These may differ from input parameter as not all fixtures may exists.
|
||||
@ -433,7 +433,7 @@ class FixtureController extends Controller
|
||||
* Filters fixtures by splitting them in two categories: one that should be applied and not.
|
||||
* If fixture is prefixed with "-", for example "-User", that means that fixture should not be loaded,
|
||||
* if it is not prefixed it is considered as one to be loaded. Returns array:
|
||||
*
|
||||
*
|
||||
* ~~~
|
||||
* [
|
||||
* 'apply' => [
|
||||
|
||||
@ -163,7 +163,7 @@ class ActiveRecord extends BaseActiveRecord
|
||||
* Finds ActiveRecord instance(s) by the given condition.
|
||||
* This method is internally called by [[findOne()]] and [[findAll()]].
|
||||
* @param mixed $condition please refer to [[findOne()]] for the explanation of this parameter
|
||||
* @return ActiveQueryInterface the newly created [[ActiveQueryInterface|ActiveQuery]] instance.
|
||||
* @return ActiveQueryInterface the newly created [[ActiveQueryInterface|ActiveQuery]] instance.
|
||||
* @throws InvalidConfigException if there is no primary key defined
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -115,7 +115,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
|
||||
* Finds ActiveRecord instance(s) by the given condition.
|
||||
* This method is internally called by [[findOne()]] and [[findAll()]].
|
||||
* @param mixed $condition please refer to [[findOne()]] for the explanation of this parameter
|
||||
* @return ActiveQueryInterface the newly created [[ActiveQueryInterface|ActiveQuery]] instance.
|
||||
* @return ActiveQueryInterface the newly created [[ActiveQueryInterface|ActiveQuery]] instance.
|
||||
* @throws InvalidConfigException if there is no primary key defined
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -24,7 +24,7 @@ use yii\base\Object;
|
||||
* 'data' => Schema::text(),
|
||||
* 'created_at' => Schema::integer(),
|
||||
* 'updated_at' => Schema::integer(),
|
||||
*]);
|
||||
* ]);
|
||||
* ```
|
||||
*
|
||||
* @method SchemaBuilder default($default = null) see [[SchemaBuilder::_default()]] for more info
|
||||
@ -38,32 +38,28 @@ abstract class SchemaBuilder extends Object
|
||||
* @var string column type
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @var integer column size
|
||||
*/
|
||||
protected $length;
|
||||
|
||||
/**
|
||||
* @var boolean whether value is not nullable
|
||||
*/
|
||||
protected $isNotNull = false;
|
||||
|
||||
/**
|
||||
* @var boolean whether value should be unique
|
||||
*/
|
||||
protected $isUnique = false;
|
||||
|
||||
/**
|
||||
* @var string check value of column
|
||||
*/
|
||||
protected $check;
|
||||
|
||||
/**
|
||||
* @var mixed default value of column
|
||||
*/
|
||||
protected $default;
|
||||
|
||||
|
||||
/**
|
||||
* Makes column a primary key
|
||||
*
|
||||
|
||||
@ -59,6 +59,7 @@ trait SchemaBuilderTrait
|
||||
'cubrid' => 'yii\db\cubrid\SchemaBuilder', // CUBRID
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Set the database connection used by this class
|
||||
*
|
||||
|
||||
@ -32,6 +32,7 @@ class Schema extends \yii\db\Schema
|
||||
'ORA-00001: unique constraint' => 'yii\db\IntegrityException',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
||||
@ -85,6 +85,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
|
||||
'NOT EXISTS' => 'buildExistsCondition',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Builds a SQL statement for creating a new index.
|
||||
* @param string $name the name of the index. The name will be properly quoted by the method.
|
||||
|
||||
@ -80,7 +80,6 @@ class BaseHtml
|
||||
'rel',
|
||||
'media',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array list of tag attributes that should be specially handled when their values are of array type.
|
||||
* In particular, if the value of the `data` attribute is `['name' => 'xyz', 'age' => 13]`, two attributes
|
||||
|
||||
@ -19,7 +19,7 @@ class BaseHtmlPurifier
|
||||
{
|
||||
/**
|
||||
* Passes markup through HTMLPurifier making it safe to output to end user
|
||||
*
|
||||
*
|
||||
* @param string $content The HTML content to purify
|
||||
* @param array|\Closure|null $config The config to use for HtmlPurifier.
|
||||
* If not specified or `null` the default config will be used.
|
||||
|
||||
@ -141,7 +141,7 @@ class BaseStringHelper
|
||||
|
||||
/**
|
||||
* Truncate a string while preserving the HTML.
|
||||
*
|
||||
*
|
||||
* @param string $string The string to truncate
|
||||
* @param integer $count
|
||||
* @param string $suffix String to append to the end of the truncated string.
|
||||
|
||||
@ -1079,7 +1079,7 @@ class Formatter extends Component
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return string the formatted result.
|
||||
* @throws InvalidParamException if the input value is not numeric or the formatting failed.
|
||||
* @throws InvalidParamException if the input value is not numeric or the formatting failed.
|
||||
* @see sizeFormat
|
||||
* @see asShortSize
|
||||
*/
|
||||
@ -1198,7 +1198,7 @@ class Formatter extends Component
|
||||
*
|
||||
* @param integer $style the type of the number formatter.
|
||||
* Values: NumberFormatter::DECIMAL, ::CURRENCY, ::PERCENT, ::SCIENTIFIC, ::SPELLOUT, ::ORDINAL
|
||||
* ::DURATION, ::PATTERN_RULEBASED, ::DEFAULT_STYLE, ::IGNORE
|
||||
* ::DURATION, ::PATTERN_RULEBASED, ::DEFAULT_STYLE, ::IGNORE
|
||||
* @param integer $decimals the number of digits after the decimal point.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
|
||||
@ -85,6 +85,7 @@ class DbManager extends BaseManager
|
||||
* @since 2.0.3
|
||||
*/
|
||||
public $cacheKey = 'rbac';
|
||||
|
||||
/**
|
||||
* @var Item[] all auth items (name => Item)
|
||||
*/
|
||||
@ -98,6 +99,7 @@ class DbManager extends BaseManager
|
||||
*/
|
||||
protected $parents;
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the application component.
|
||||
* This method overrides the parent implementation by establishing the database connection.
|
||||
|
||||
@ -31,6 +31,7 @@ class ArrayFixture extends Fixture implements \IteratorAggregate, \ArrayAccess,
|
||||
*/
|
||||
public $dataFile;
|
||||
|
||||
|
||||
/**
|
||||
* Loads the fixture.
|
||||
*
|
||||
|
||||
@ -122,7 +122,7 @@ class FileValidator extends Validator
|
||||
* - {mimeTypes}: the value of [[mimeTypes]]
|
||||
*/
|
||||
public $wrongMimeType;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
|
||||
@ -12,12 +12,12 @@ namespace yii\validators;
|
||||
*
|
||||
* This class is required because of the way in which Yii determines whether a property is safe for massive assignment, that is,
|
||||
* when a user submits form data to be loaded into a model directly from the POST data, is it ok for a property to be copied.
|
||||
* In many cases, this is required but because sometimes properties are internal and you do not want the POST data to be able to
|
||||
* In many cases, this is required but because sometimes properties are internal and you do not want the POST data to be able to
|
||||
* override these internal values (especially things like database row ids), Yii assumes all values are unsafe for massive assignment
|
||||
* unless a rule exists for the property, which in most cases it will. Sometimes, however, an item is safe for massive assigment but
|
||||
* does not have a rule associated with it - for instance, due to no validation being performed, in which case, you use this class
|
||||
* as a rule for that property. Although it has no functionality, it allows Yii to determine that the property is safe to copy.
|
||||
*
|
||||
*
|
||||
* @author Qiang Xue <qiang.xue@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
|
||||
@ -50,6 +50,7 @@ class Application extends \yii\base\Application
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
||||
@ -72,7 +72,6 @@ class Response extends \yii\base\Response
|
||||
* You may respond to this event to filter the response content before it is sent to the client.
|
||||
*/
|
||||
const EVENT_AFTER_PREPARE = 'afterPrepare';
|
||||
|
||||
const FORMAT_RAW = 'raw';
|
||||
const FORMAT_HTML = 'html';
|
||||
const FORMAT_JSON = 'json';
|
||||
@ -426,7 +425,7 @@ class Response extends \yii\base\Response
|
||||
*
|
||||
* - `mimeType`: the MIME type of the content. If not set, it will be guessed based on `$filePath`
|
||||
* - `inline`: boolean, whether the browser should open the file within the browser window. Defaults to false,
|
||||
* meaning a download dialog will pop up.
|
||||
* meaning a download dialog will pop up.
|
||||
*
|
||||
* @return $this the response object itself
|
||||
*/
|
||||
@ -456,7 +455,7 @@ class Response extends \yii\base\Response
|
||||
*
|
||||
* - `mimeType`: the MIME type of the content. Defaults to 'application/octet-stream'.
|
||||
* - `inline`: boolean, whether the browser should open the file within the browser window. Defaults to false,
|
||||
* meaning a download dialog will pop up.
|
||||
* meaning a download dialog will pop up.
|
||||
*
|
||||
* @return $this the response object itself
|
||||
* @throws HttpException if the requested range is not satisfiable
|
||||
@ -503,10 +502,10 @@ class Response extends \yii\base\Response
|
||||
*
|
||||
* - `mimeType`: the MIME type of the content. Defaults to 'application/octet-stream'.
|
||||
* - `inline`: boolean, whether the browser should open the file within the browser window. Defaults to false,
|
||||
* meaning a download dialog will pop up.
|
||||
* meaning a download dialog will pop up.
|
||||
* - `fileSize`: the size of the content to stream this is useful when size of the content is known
|
||||
* and the content is not seekable. Defaults to content size using `ftell()`.
|
||||
* This option is available since version 2.0.4.
|
||||
* and the content is not seekable. Defaults to content size using `ftell()`.
|
||||
* This option is available since version 2.0.4.
|
||||
*
|
||||
* @return $this the response object itself
|
||||
* @throws HttpException if the requested range cannot be satisfied.
|
||||
@ -660,7 +659,7 @@ class Response extends \yii\base\Response
|
||||
*
|
||||
* - `mimeType`: the MIME type of the content. If not set, it will be guessed based on `$filePath`
|
||||
* - `inline`: boolean, whether the browser should open the file within the browser window. Defaults to false,
|
||||
* meaning a download dialog will pop up.
|
||||
* meaning a download dialog will pop up.
|
||||
* - xHeader: string, the name of the x-sendfile header. Defaults to "X-Sendfile".
|
||||
*
|
||||
* @return $this the response object itself
|
||||
|
||||
@ -678,7 +678,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
|
||||
*
|
||||
* With the above code you can use the [bootstrap alert][] classes such as `success`, `info`, `danger`
|
||||
* as the flash message key to influence the color of the div.
|
||||
*
|
||||
*
|
||||
* Note that if you use [[addFlash()]], `$message` will be an array, and you will have to adjust the above code.
|
||||
*
|
||||
* [bootstrap alert]: http://getbootstrap.com/components/#alerts
|
||||
|
||||
Reference in New Issue
Block a user