Add visibility for all class elements (#20557)

This commit is contained in:
Maksim Spirkov
2025-10-02 02:27:23 +04:00
committed by GitHub
parent 813dfc07cc
commit c82da8dc82
73 changed files with 328 additions and 331 deletions

View File

@ -1032,8 +1032,8 @@ class ReleaseController extends Controller
return $versions;
}
const MINOR = 'minor';
const PATCH = 'patch';
public const MINOR = 'minor';
public const PATCH = 'patch';
protected function getNextVersions(array $versions, $type)
{

View File

@ -49,39 +49,39 @@ abstract class Application extends Module
/**
* @event Event an event raised before the application starts to handle a request.
*/
const EVENT_BEFORE_REQUEST = 'beforeRequest';
public const EVENT_BEFORE_REQUEST = 'beforeRequest';
/**
* @event Event an event raised after the application successfully handles a request (before the response is sent out).
*/
const EVENT_AFTER_REQUEST = 'afterRequest';
public const EVENT_AFTER_REQUEST = 'afterRequest';
/**
* Application state used by [[state]]: application just started.
*/
const STATE_BEGIN = 0;
public const STATE_BEGIN = 0;
/**
* Application state used by [[state]]: application is initializing.
*/
const STATE_INIT = 1;
public const STATE_INIT = 1;
/**
* Application state used by [[state]]: application is triggering [[EVENT_BEFORE_REQUEST]].
*/
const STATE_BEFORE_REQUEST = 2;
public const STATE_BEFORE_REQUEST = 2;
/**
* Application state used by [[state]]: application is handling the request.
*/
const STATE_HANDLING_REQUEST = 3;
public const STATE_HANDLING_REQUEST = 3;
/**
* Application state used by [[state]]: application is triggering [[EVENT_AFTER_REQUEST]]..
*/
const STATE_AFTER_REQUEST = 4;
public const STATE_AFTER_REQUEST = 4;
/**
* Application state used by [[state]]: application is about to send response.
*/
const STATE_SENDING_RESPONSE = 5;
public const STATE_SENDING_RESPONSE = 5;
/**
* Application state used by [[state]]: application has ended.
*/
const STATE_END = 6;
public const STATE_END = 6;
/**
* @var string the namespace that controller classes are located in.

View File

@ -31,11 +31,11 @@ class Controller extends Component implements ViewContextInterface
* @event ActionEvent an event raised right before executing a controller action.
* You may set [[ActionEvent::isValid]] to be false to cancel the action execution.
*/
const EVENT_BEFORE_ACTION = 'beforeAction';
public const EVENT_BEFORE_ACTION = 'beforeAction';
/**
* @event ActionEvent an event raised right after executing a controller action.
*/
const EVENT_AFTER_ACTION = 'afterAction';
public const EVENT_AFTER_ACTION = 'afterAction';
/**
* @var string the ID of this controller.

View File

@ -25,7 +25,7 @@ class ErrorException extends \ErrorException
* @see https://github.com/facebook/hhvm/blob/master/hphp/runtime/base/runtime-error.h#L62
* @since 2.0.6
*/
const E_HHVM_FATAL_ERROR = 16777217; // E_ERROR | (1 << 24)
public const E_HHVM_FATAL_ERROR = 16777217; // E_ERROR | (1 << 24)
/**

View File

@ -30,7 +30,7 @@ abstract class ErrorHandler extends Component
* @event Event an event that is triggered when the handler is called by shutdown function via [[handleFatalError()]].
* @since 2.0.46
*/
const EVENT_SHUTDOWN = 'shutdown';
public const EVENT_SHUTDOWN = 'shutdown';
/**
* @var bool whether to discard any existing page output before error display. Defaults to true.

View File

@ -83,16 +83,16 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
/**
* The name of the default scenario.
*/
const SCENARIO_DEFAULT = 'default';
public const SCENARIO_DEFAULT = 'default';
/**
* @event ModelEvent an event raised at the beginning of [[validate()]]. You may set
* [[ModelEvent::isValid]] to be false to stop the validation.
*/
const EVENT_BEFORE_VALIDATE = 'beforeValidate';
public const EVENT_BEFORE_VALIDATE = 'beforeValidate';
/**
* @event Event an event raised at the end of [[validate()]]
*/
const EVENT_AFTER_VALIDATE = 'afterValidate';
public const EVENT_AFTER_VALIDATE = 'afterValidate';
/**
* @var array validation errors (attribute name => array of errors)

View File

@ -44,11 +44,11 @@ class Module extends ServiceLocator
* @event ActionEvent an event raised before executing a controller action.
* You may set [[ActionEvent::isValid]] to be `false` to cancel the action execution.
*/
const EVENT_BEFORE_ACTION = 'beforeAction';
public const EVENT_BEFORE_ACTION = 'beforeAction';
/**
* @event ActionEvent an event raised after executing a controller action.
*/
const EVENT_AFTER_ACTION = 'afterAction';
public const EVENT_AFTER_ACTION = 'afterAction';
/**
* @var array custom module parameters (name => value).

View File

@ -32,19 +32,19 @@ class View extends Component implements DynamicContentAwareInterface
/**
* @event Event an event that is triggered by [[beginPage()]].
*/
const EVENT_BEGIN_PAGE = 'beginPage';
public const EVENT_BEGIN_PAGE = 'beginPage';
/**
* @event Event an event that is triggered by [[endPage()]].
*/
const EVENT_END_PAGE = 'endPage';
public const EVENT_END_PAGE = 'endPage';
/**
* @event ViewEvent an event that is triggered by [[renderFile()]] right before it renders a view file.
*/
const EVENT_BEFORE_RENDER = 'beforeRender';
public const EVENT_BEFORE_RENDER = 'beforeRender';
/**
* @event ViewEvent an event that is triggered by [[renderFile()]] right after it renders a view file.
*/
const EVENT_AFTER_RENDER = 'afterRender';
public const EVENT_AFTER_RENDER = 'afterRender';
/**
* @var ViewContextInterface the context under which the [[renderFile()]] method is being invoked.

View File

@ -30,18 +30,18 @@ class Widget extends Component implements ViewContextInterface
* @event Event an event that is triggered when the widget is initialized via [[init()]].
* @since 2.0.11
*/
const EVENT_INIT = 'init';
public const EVENT_INIT = 'init';
/**
* @event WidgetEvent an event raised right before executing a widget.
* You may set [[WidgetEvent::isValid]] to be false to cancel the widget execution.
* @since 2.0.11
*/
const EVENT_BEFORE_RUN = 'beforeRun';
public const EVENT_BEFORE_RUN = 'beforeRun';
/**
* @event WidgetEvent an event raised right after executing a widget.
* @since 2.0.11
*/
const EVENT_AFTER_RUN = 'afterRun';
public const EVENT_AFTER_RUN = 'afterRun';
/**
* @var int a counter used to generate [[id]] for widgets.

View File

@ -111,10 +111,10 @@ use yii\validators\StringValidator;
*/
class AttributeTypecastBehavior extends Behavior
{
const TYPE_INTEGER = 'integer';
const TYPE_FLOAT = 'float';
const TYPE_BOOLEAN = 'boolean';
const TYPE_STRING = 'string';
public const TYPE_INTEGER = 'integer';
public const TYPE_FLOAT = 'float';
public const TYPE_BOOLEAN = 'boolean';
public const TYPE_STRING = 'string';
/**
* @var Model|BaseActiveRecord the owner of this behavior.

View File

@ -45,7 +45,7 @@ class CaptchaAction extends Action
/**
* The name of the GET parameter indicating whether the CAPTCHA image should be regenerated.
*/
const REFRESH_GET_VAR = 'refresh';
public const REFRESH_GET_VAR = 'refresh';
/**
* @var int how many times should the same CAPTCHA be displayed. Defaults to 3.

View File

@ -62,7 +62,7 @@ class Application extends \yii\base\Application
/**
* The option name for specifying the application configuration file path.
*/
const OPTION_APPCONFIG = 'appconfig';
public const OPTION_APPCONFIG = 'appconfig';
/**
* @var string the default route of this application. Defaults to 'help',

View File

@ -43,11 +43,11 @@ class Controller extends \yii\base\Controller
/**
* @deprecated since 2.0.13. Use [[ExitCode::OK]] instead.
*/
const EXIT_CODE_NORMAL = 0;
public const EXIT_CODE_NORMAL = 0;
/**
* @deprecated since 2.0.13. Use [[ExitCode::UNSPECIFIED_ERROR]] instead.
*/
const EXIT_CODE_ERROR = 1;
public const EXIT_CODE_ERROR = 1;
/**
* @var bool whether to run the command interactively.

View File

@ -38,89 +38,89 @@ class ExitCode
/**
* The command completed successfully.
*/
const OK = 0;
public const OK = 0;
/**
* The command exited with an error code that says nothing about the error.
*/
const UNSPECIFIED_ERROR = 1;
public const UNSPECIFIED_ERROR = 1;
/**
* The command was used incorrectly, e.g., with the wrong number of
* arguments, a bad flag, a bad syntax in a parameter, or whatever.
*/
const USAGE = 64;
public const USAGE = 64;
/**
* The input data was incorrect in some way. This should only be used for
* user's data and not system files.
*/
const DATAERR = 65;
public const DATAERR = 65;
/**
* An input file (not a system file) did not exist or was not readable.
* This could also include errors like ``No message'' to a mailer (if it
* cared to catch it).
*/
const NOINPUT = 66;
public const NOINPUT = 66;
/**
* The user specified did not exist. This might be used for mail addresses
* or remote logins.
*/
const NOUSER = 67;
public const NOUSER = 67;
/**
* The host specified did not exist. This is used in mail addresses or
* network requests.
*/
const NOHOST = 68;
public const NOHOST = 68;
/**
* A service is unavailable. This can occur if a support program or file
* does not exist. This can also be used as a catchall message when
* something you wanted to do does not work, but you do not know why.
*/
const UNAVAILABLE = 69;
public const UNAVAILABLE = 69;
/**
* An internal software error has been detected. This should be limited to
* non-operating system related errors as possible.
*/
const SOFTWARE = 70;
public const SOFTWARE = 70;
/**
* An operating system error has been detected. This is intended to be
* used for such things as ``cannot fork'', ``cannot create pipe'', or the
* like. It includes things like getuid returning a user that does not
* exist in the passwd file.
*/
const OSERR = 71;
public const OSERR = 71;
/**
* Some system file (e.g., /etc/passwd, /var/run/utx.active, etc.) does not
* exist, cannot be opened, or has some sort of error (e.g., syntax error).
*/
const OSFILE = 72;
public const OSFILE = 72;
/**
* A (user specified) output file cannot be created.
*/
const CANTCREAT = 73;
public const CANTCREAT = 73;
/**
* An error occurred while doing I/O on some file.
*/
const IOERR = 74;
public const IOERR = 74;
/**
* Temporary failure, indicating something that is not really an error. In
* sendmail, this means that a mailer (e.g.) could not create a connection,
* and the request should be reattempted later.
*/
const TEMPFAIL = 75;
public const TEMPFAIL = 75;
/**
* The remote system returned something that was ``not possible'' during a
* protocol exchange.
*/
const PROTOCOL = 76;
public const PROTOCOL = 76;
/**
* You did not have sufficient permission to perform the operation. This
* is not intended for file system problems, which should use NOINPUT or
* CANTCREAT, but rather for higher level permissions.
*/
const NOPERM = 77;
public const NOPERM = 77;
/**
* Something was found in an unconfigured or misconfigured state.
*/
const CONFIG = 78;
public const CONFIG = 78;
/**
* @var array a map of reason descriptions for exit codes.

View File

@ -30,7 +30,7 @@ abstract class BaseMigrateController extends Controller
/**
* The name of the dummy migration that marks the beginning of the whole migration history.
*/
const BASE_MIGRATION = 'm000000_000000_base';
public const BASE_MIGRATION = 'm000000_000000_base';
/**
* @var string the default command action.

View File

@ -78,7 +78,7 @@ class MigrateController extends BaseMigrateController
* Maximum length of a migration name.
* @since 2.0.13
*/
const MAX_NAME_LENGTH = 180;
public const MAX_NAME_LENGTH = 180;
/**
* @var string the name of the table for keeping applied migration information.

View File

@ -23,10 +23,10 @@ use yii\helpers\Console;
*/
class ServeController extends Controller
{
const EXIT_CODE_NO_DOCUMENT_ROOT = 2;
const EXIT_CODE_NO_ROUTING_FILE = 3;
const EXIT_CODE_ADDRESS_TAKEN_BY_ANOTHER_SERVER = 4;
const EXIT_CODE_ADDRESS_TAKEN_BY_ANOTHER_PROCESS = 5;
public const EXIT_CODE_NO_DOCUMENT_ROOT = 2;
public const EXIT_CODE_NO_ROUTING_FILE = 3;
public const EXIT_CODE_ADDRESS_TAKEN_BY_ANOTHER_SERVER = 4;
public const EXIT_CODE_ADDRESS_TAKEN_BY_ANOTHER_PROCESS = 5;
/**
* @var int port to serve on.

View File

@ -51,23 +51,23 @@ use yii\helpers\Console;
*/
class Table extends Widget
{
const DEFAULT_CONSOLE_SCREEN_WIDTH = 120;
const CONSOLE_SCROLLBAR_OFFSET = 3;
const CHAR_TOP = 'top';
const CHAR_TOP_MID = 'top-mid';
const CHAR_TOP_LEFT = 'top-left';
const CHAR_TOP_RIGHT = 'top-right';
const CHAR_BOTTOM = 'bottom';
const CHAR_BOTTOM_MID = 'bottom-mid';
const CHAR_BOTTOM_LEFT = 'bottom-left';
const CHAR_BOTTOM_RIGHT = 'bottom-right';
const CHAR_LEFT = 'left';
const CHAR_LEFT_MID = 'left-mid';
const CHAR_MID = 'mid';
const CHAR_MID_MID = 'mid-mid';
const CHAR_RIGHT = 'right';
const CHAR_RIGHT_MID = 'right-mid';
const CHAR_MIDDLE = 'middle';
public const DEFAULT_CONSOLE_SCREEN_WIDTH = 120;
public const CONSOLE_SCROLLBAR_OFFSET = 3;
public const CHAR_TOP = 'top';
public const CHAR_TOP_MID = 'top-mid';
public const CHAR_TOP_LEFT = 'top-left';
public const CHAR_TOP_RIGHT = 'top-right';
public const CHAR_BOTTOM = 'bottom';
public const CHAR_BOTTOM_MID = 'bottom-mid';
public const CHAR_BOTTOM_LEFT = 'bottom-left';
public const CHAR_BOTTOM_RIGHT = 'bottom-right';
public const CHAR_LEFT = 'left';
public const CHAR_LEFT_MID = 'left-mid';
public const CHAR_MID = 'mid';
public const CHAR_MID_MID = 'mid-mid';
public const CHAR_RIGHT = 'right';
public const CHAR_RIGHT_MID = 'right-mid';
public const CHAR_MIDDLE = 'middle';
/**
* @var array table headers

View File

@ -125,14 +125,14 @@ use yii\validators\Validator;
*/
class DataFilter extends Model
{
const TYPE_INTEGER = 'integer';
const TYPE_FLOAT = 'float';
const TYPE_BOOLEAN = 'boolean';
const TYPE_STRING = 'string';
const TYPE_ARRAY = 'array';
const TYPE_DATETIME = 'datetime';
const TYPE_DATE = 'date';
const TYPE_TIME = 'time';
public const TYPE_INTEGER = 'integer';
public const TYPE_FLOAT = 'float';
public const TYPE_BOOLEAN = 'boolean';
public const TYPE_STRING = 'string';
public const TYPE_ARRAY = 'array';
public const TYPE_DATETIME = 'datetime';
public const TYPE_DATE = 'date';
public const TYPE_TIME = 'time';
/**
* @var string name of the attribute that handles filter value.

View File

@ -75,10 +75,10 @@ use yii\web\Request;
*/
class Pagination extends BaseObject implements Linkable
{
const LINK_NEXT = 'next';
const LINK_PREV = 'prev';
const LINK_FIRST = 'first';
const LINK_LAST = 'last';
public const LINK_NEXT = 'next';
public const LINK_PREV = 'prev';
public const LINK_FIRST = 'first';
public const LINK_LAST = 'last';
/**
* @var string name of the parameter storing the current page index.

View File

@ -95,7 +95,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
/**
* @event Event an event that is triggered when the query is initialized via [[init()]].
*/
const EVENT_INIT = 'init';
public const EVENT_INIT = 'init';
/**
* @var string|null the SQL statement to be executed for retrieving AR records.

View File

@ -79,20 +79,20 @@ class ActiveRecord extends BaseActiveRecord
/**
* The insert operation. This is mainly used when overriding [[transactions()]] to specify which operations are transactional.
*/
const OP_INSERT = 0x01;
public const OP_INSERT = 0x01;
/**
* The update operation. This is mainly used when overriding [[transactions()]] to specify which operations are transactional.
*/
const OP_UPDATE = 0x02;
public const OP_UPDATE = 0x02;
/**
* The delete operation. This is mainly used when overriding [[transactions()]] to specify which operations are transactional.
*/
const OP_DELETE = 0x04;
public const OP_DELETE = 0x04;
/**
* All three operations: insert, update, delete.
* This is a shortcut of the expression: OP_INSERT | OP_UPDATE | OP_DELETE.
*/
const OP_ALL = 0x07;
public const OP_ALL = 0x07;
/**

View File

@ -44,43 +44,43 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* @event Event an event that is triggered when the record is initialized via [[init()]].
*/
const EVENT_INIT = 'init';
public const EVENT_INIT = 'init';
/**
* @event Event an event that is triggered after the record is created and populated with query result.
*/
const EVENT_AFTER_FIND = 'afterFind';
public const EVENT_AFTER_FIND = 'afterFind';
/**
* @event ModelEvent an event that is triggered before inserting a record.
* You may set [[ModelEvent::isValid]] to be `false` to stop the insertion.
*/
const EVENT_BEFORE_INSERT = 'beforeInsert';
public const EVENT_BEFORE_INSERT = 'beforeInsert';
/**
* @event AfterSaveEvent an event that is triggered after a record is inserted.
*/
const EVENT_AFTER_INSERT = 'afterInsert';
public const EVENT_AFTER_INSERT = 'afterInsert';
/**
* @event ModelEvent an event that is triggered before updating a record.
* You may set [[ModelEvent::isValid]] to be `false` to stop the update.
*/
const EVENT_BEFORE_UPDATE = 'beforeUpdate';
public const EVENT_BEFORE_UPDATE = 'beforeUpdate';
/**
* @event AfterSaveEvent an event that is triggered after a record is updated.
*/
const EVENT_AFTER_UPDATE = 'afterUpdate';
public const EVENT_AFTER_UPDATE = 'afterUpdate';
/**
* @event ModelEvent an event that is triggered before deleting a record.
* You may set [[ModelEvent::isValid]] to be `false` to stop the deletion.
*/
const EVENT_BEFORE_DELETE = 'beforeDelete';
public const EVENT_BEFORE_DELETE = 'beforeDelete';
/**
* @event Event an event that is triggered after a record is deleted.
*/
const EVENT_AFTER_DELETE = 'afterDelete';
public const EVENT_AFTER_DELETE = 'afterDelete';
/**
* @event Event an event that is triggered after a record is refreshed.
* @since 2.0.8
*/
const EVENT_AFTER_REFRESH = 'afterRefresh';
public const EVENT_AFTER_REFRESH = 'afterRefresh';
/**
* @var array attribute values indexed by attribute names

View File

@ -35,17 +35,17 @@ class BatchQueryResult extends Component implements \Iterator
* @see reset()
* @since 2.0.41
*/
const EVENT_RESET = 'reset';
public const EVENT_RESET = 'reset';
/**
* @event Event an event that is triggered when the last batch has been fetched.
* @since 2.0.41
*/
const EVENT_FINISH = 'finish';
public const EVENT_FINISH = 'finish';
/**
* MSSQL error code for exception that is thrown when last batch is size less than specified batch size
* @see https://github.com/yiisoft/yii2/issues/10023
*/
const MSSQL_NO_MORE_ROWS_ERROR_CODE = -13;
public const MSSQL_NO_MORE_ROWS_ERROR_CODE = -13;
/**
* @var Connection|null the DB connection to be used when performing batch query.

View File

@ -25,11 +25,11 @@ class ColumnSchemaBuilder extends BaseObject
// Internally used constants representing categories that abstract column types fall under.
// See [[$categoryMap]] for mappings of abstract column types to category.
// @since 2.0.8
const CATEGORY_PK = 'pk';
const CATEGORY_STRING = 'string';
const CATEGORY_NUMERIC = 'numeric';
const CATEGORY_TIME = 'time';
const CATEGORY_OTHER = 'other';
public const CATEGORY_PK = 'pk';
public const CATEGORY_STRING = 'string';
public const CATEGORY_NUMERIC = 'numeric';
public const CATEGORY_TIME = 'time';
public const CATEGORY_OTHER = 'other';
/**
* @var string the column type definition such as INTEGER, VARCHAR, DATETIME, etc.

View File

@ -137,19 +137,19 @@ class Connection extends Component
/**
* @event \yii\base\Event an event that is triggered after a DB connection is established
*/
const EVENT_AFTER_OPEN = 'afterOpen';
public const EVENT_AFTER_OPEN = 'afterOpen';
/**
* @event \yii\base\Event an event that is triggered right before a top-level transaction is started
*/
const EVENT_BEGIN_TRANSACTION = 'beginTransaction';
public const EVENT_BEGIN_TRANSACTION = 'beginTransaction';
/**
* @event \yii\base\Event an event that is triggered right after a top-level transaction is committed
*/
const EVENT_COMMIT_TRANSACTION = 'commitTransaction';
public const EVENT_COMMIT_TRANSACTION = 'commitTransaction';
/**
* @event \yii\base\Event an event that is triggered right after a top-level transaction is rolled back
*/
const EVENT_ROLLBACK_TRANSACTION = 'rollbackTransaction';
public const EVENT_ROLLBACK_TRANSACTION = 'rollbackTransaction';
/**
* @var string the Data Source Name, or DSN, contains the information required to connect to the database.

View File

@ -23,8 +23,8 @@ use yii\base\InvalidConfigException;
*/
class JsonExpression implements ExpressionInterface, \JsonSerializable
{
const TYPE_JSON = 'json';
const TYPE_JSONB = 'jsonb';
public const TYPE_JSON = 'json';
public const TYPE_JSONB = 'jsonb';
/**
* @var mixed the value to be encoded to JSON.

View File

@ -15,7 +15,7 @@ namespace yii\db;
*/
class PdoValueBuilder implements ExpressionBuilderInterface
{
const PARAM_PREFIX = ':pv';
public const PARAM_PREFIX = ':pv';
/**

View File

@ -38,7 +38,7 @@ class QueryBuilder extends \yii\base\BaseObject
/**
* The prefix for automatically generated query binding parameters.
*/
const PARAM_PREFIX = ':qp';
public const PARAM_PREFIX = ':qp';
/**
* @var Connection the database connection.

View File

@ -41,33 +41,33 @@ use yii\caching\TagDependency;
abstract class Schema extends BaseObject
{
// The following are the supported abstract column data types.
const TYPE_PK = 'pk';
const TYPE_UPK = 'upk';
const TYPE_BIGPK = 'bigpk';
const TYPE_UBIGPK = 'ubigpk';
const TYPE_CHAR = 'char';
const TYPE_STRING = 'string';
const TYPE_TEXT = 'text';
const TYPE_TINYINT = 'tinyint';
const TYPE_SMALLINT = 'smallint';
const TYPE_INTEGER = 'integer';
const TYPE_BIGINT = 'bigint';
const TYPE_FLOAT = 'float';
const TYPE_DOUBLE = 'double';
const TYPE_DECIMAL = 'decimal';
const TYPE_DATETIME = 'datetime';
const TYPE_TIMESTAMP = 'timestamp';
const TYPE_TIME = 'time';
const TYPE_DATE = 'date';
const TYPE_BINARY = 'binary';
const TYPE_BOOLEAN = 'boolean';
const TYPE_MONEY = 'money';
const TYPE_JSON = 'json';
public const TYPE_PK = 'pk';
public const TYPE_UPK = 'upk';
public const TYPE_BIGPK = 'bigpk';
public const TYPE_UBIGPK = 'ubigpk';
public const TYPE_CHAR = 'char';
public const TYPE_STRING = 'string';
public const TYPE_TEXT = 'text';
public const TYPE_TINYINT = 'tinyint';
public const TYPE_SMALLINT = 'smallint';
public const TYPE_INTEGER = 'integer';
public const TYPE_BIGINT = 'bigint';
public const TYPE_FLOAT = 'float';
public const TYPE_DOUBLE = 'double';
public const TYPE_DECIMAL = 'decimal';
public const TYPE_DATETIME = 'datetime';
public const TYPE_TIMESTAMP = 'timestamp';
public const TYPE_TIME = 'time';
public const TYPE_DATE = 'date';
public const TYPE_BINARY = 'binary';
public const TYPE_BOOLEAN = 'boolean';
public const TYPE_MONEY = 'money';
public const TYPE_JSON = 'json';
/**
* Schema cache version, to detect incompatibilities in cached values when the
* data format of the cache changes.
*/
const SCHEMA_CACHE_VERSION = 1;
public const SCHEMA_CACHE_VERSION = 1;
/**
* @var Connection the database connection

View File

@ -22,14 +22,14 @@ use yii\base\BaseObject;
*/
class SqlToken extends BaseObject implements \ArrayAccess
{
const TYPE_CODE = 0;
const TYPE_STATEMENT = 1;
const TYPE_TOKEN = 2;
const TYPE_PARENTHESIS = 3;
const TYPE_KEYWORD = 4;
const TYPE_OPERATOR = 5;
const TYPE_IDENTIFIER = 6;
const TYPE_STRING_LITERAL = 7;
public const TYPE_CODE = 0;
public const TYPE_STATEMENT = 1;
public const TYPE_TOKEN = 2;
public const TYPE_PARENTHESIS = 3;
public const TYPE_KEYWORD = 4;
public const TYPE_OPERATOR = 5;
public const TYPE_IDENTIFIER = 6;
public const TYPE_STRING_LITERAL = 7;
/**
* @var int token type. It has to be one of the following constants:

View File

@ -55,22 +55,22 @@ class Transaction extends \yii\base\BaseObject
* A constant representing the transaction isolation level `READ UNCOMMITTED`.
* @see https://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels
*/
const READ_UNCOMMITTED = 'READ UNCOMMITTED';
public const READ_UNCOMMITTED = 'READ UNCOMMITTED';
/**
* A constant representing the transaction isolation level `READ COMMITTED`.
* @see https://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels
*/
const READ_COMMITTED = 'READ COMMITTED';
public const READ_COMMITTED = 'READ COMMITTED';
/**
* A constant representing the transaction isolation level `REPEATABLE READ`.
* @see https://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels
*/
const REPEATABLE_READ = 'REPEATABLE READ';
public const REPEATABLE_READ = 'REPEATABLE READ';
/**
* A constant representing the transaction isolation level `SERIALIZABLE`.
* @see https://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels
*/
const SERIALIZABLE = 'SERIALIZABLE';
public const SERIALIZABLE = 'SERIALIZABLE';
/**
* @var Connection the database connection that this transaction is associated with.

View File

@ -24,7 +24,7 @@ class JsonExpressionBuilder implements ExpressionBuilderInterface
{
use ExpressionBuilderTrait;
const PARAM_PREFIX = ':qp';
public const PARAM_PREFIX = ':qp';
/**

View File

@ -26,27 +26,27 @@ class QueryBuilder extends \yii\db\QueryBuilder
* Defines a UNIQUE index for [[createIndex()]].
* @since 2.0.6
*/
const INDEX_UNIQUE = 'unique';
public const INDEX_UNIQUE = 'unique';
/**
* Defines a B-tree index for [[createIndex()]].
* @since 2.0.6
*/
const INDEX_B_TREE = 'btree';
public const INDEX_B_TREE = 'btree';
/**
* Defines a hash index for [[createIndex()]].
* @since 2.0.6
*/
const INDEX_HASH = 'hash';
public const INDEX_HASH = 'hash';
/**
* Defines a GiST index for [[createIndex()]].
* @since 2.0.6
*/
const INDEX_GIST = 'gist';
public const INDEX_GIST = 'gist';
/**
* Defines a GIN index for [[createIndex()]].
* @since 2.0.6
*/
const INDEX_GIN = 'gin';
public const INDEX_GIN = 'gin';
/**
* @var array mapping from abstract column types (keys) to physical column types (values).

View File

@ -32,7 +32,7 @@ class Schema extends \yii\db\Schema implements ConstraintFinderInterface
use ViewFinderTrait;
use ConstraintFinderTrait;
const TYPE_JSONB = 'jsonb';
public const TYPE_JSONB = 'jsonb';
/**
* @var string the default schema used for the current session.

View File

@ -60,7 +60,7 @@ class PageCache extends ActionFilter implements DynamicContentAwareInterface
* Page cache version, to detect incompatibilities in cached values when the
* data format of the cache changes.
*/
const PAGE_CACHE_VERSION = 1;
public const PAGE_CACHE_VERSION = 1;
/**
* @var bool whether the content being cached should be differentiated according to the route.

View File

@ -48,9 +48,9 @@ use yii\widgets\BaseListView;
*/
class GridView extends BaseListView
{
const FILTER_POS_HEADER = 'header';
const FILTER_POS_FOOTER = 'footer';
const FILTER_POS_BODY = 'body';
public const FILTER_POS_HEADER = 'header';
public const FILTER_POS_FOOTER = 'footer';
public const FILTER_POS_BODY = 'body';
/**
* @var string the default data column class if the class name is not explicitly specified when configuring a data column.

View File

@ -22,36 +22,36 @@ use yii\base\Model;
class BaseConsole
{
// foreground color control codes
const FG_BLACK = 30;
const FG_RED = 31;
const FG_GREEN = 32;
const FG_YELLOW = 33;
const FG_BLUE = 34;
const FG_PURPLE = 35;
const FG_CYAN = 36;
const FG_GREY = 37;
public const FG_BLACK = 30;
public const FG_RED = 31;
public const FG_GREEN = 32;
public const FG_YELLOW = 33;
public const FG_BLUE = 34;
public const FG_PURPLE = 35;
public const FG_CYAN = 36;
public const FG_GREY = 37;
// background color control codes
const BG_BLACK = 40;
const BG_RED = 41;
const BG_GREEN = 42;
const BG_YELLOW = 43;
const BG_BLUE = 44;
const BG_PURPLE = 45;
const BG_CYAN = 46;
const BG_GREY = 47;
public const BG_BLACK = 40;
public const BG_RED = 41;
public const BG_GREEN = 42;
public const BG_YELLOW = 43;
public const BG_BLUE = 44;
public const BG_PURPLE = 45;
public const BG_CYAN = 46;
public const BG_GREY = 47;
// fonts style control codes
const RESET = 0;
const NORMAL = 0;
const BOLD = 1;
const ITALIC = 3;
const UNDERLINE = 4;
const BLINK = 5;
const NEGATIVE = 7;
const CONCEALED = 8;
const CROSSED_OUT = 9;
const FRAMED = 51;
const ENCIRCLED = 52;
const OVERLINED = 53;
public const RESET = 0;
public const NORMAL = 0;
public const BOLD = 1;
public const ITALIC = 3;
public const UNDERLINE = 4;
public const BLINK = 5;
public const NEGATIVE = 7;
public const CONCEALED = 8;
public const CROSSED_OUT = 9;
public const FRAMED = 51;
public const ENCIRCLED = 52;
public const OVERLINED = 53;
/**

View File

@ -24,11 +24,11 @@ use yii\base\InvalidConfigException;
*/
class BaseFileHelper
{
const PATTERN_NODIR = 1;
const PATTERN_ENDSWITH = 4;
const PATTERN_MUSTBEDIR = 8;
const PATTERN_NEGATIVE = 16;
const PATTERN_CASE_INSENSITIVE = 32;
public const PATTERN_NODIR = 1;
public const PATTERN_ENDSWITH = 4;
public const PATTERN_MUSTBEDIR = 8;
public const PATTERN_NEGATIVE = 16;
public const PATTERN_CASE_INSENSITIVE = 32;
/**
* @var string the path (or alias) of a PHP file containing MIME type information.

View File

@ -251,7 +251,7 @@ class BaseInflector
* @see transliterate()
* @since 2.0.7
*/
const TRANSLITERATE_STRICT = 'Any-Latin; NFKD';
public const TRANSLITERATE_STRICT = 'Any-Latin; NFKD';
/**
* Shortcut for `Any-Latin; Latin-ASCII` transliteration rule.
*
@ -266,7 +266,7 @@ class BaseInflector
* @see transliterate()
* @since 2.0.7
*/
const TRANSLITERATE_MEDIUM = 'Any-Latin; Latin-ASCII';
public const TRANSLITERATE_MEDIUM = 'Any-Latin; Latin-ASCII';
/**
* Shortcut for `Any-Latin; Latin-ASCII; [\u0080-\uffff] remove` transliteration rule.
*
@ -282,7 +282,7 @@ class BaseInflector
* @see transliterate()
* @since 2.0.7
*/
const TRANSLITERATE_LOOSE = 'Any-Latin; Latin-ASCII; [\u0080-\uffff] remove';
public const TRANSLITERATE_LOOSE = 'Any-Latin; Latin-ASCII; [\u0080-\uffff] remove';
/**
* @var mixed Either a [[\Transliterator]], or a string from which a [[\Transliterator]] can be built

View File

@ -19,16 +19,16 @@ use yii\base\NotSupportedException;
*/
class BaseIpHelper
{
const IPV4 = 4;
const IPV6 = 6;
public const IPV4 = 4;
public const IPV6 = 6;
/**
* The length of IPv6 address in bits
*/
const IPV6_ADDRESS_LENGTH = 128;
public const IPV6_ADDRESS_LENGTH = 128;
/**
* The length of IPv4 address in bits
*/
const IPV4_ADDRESS_LENGTH = 32;
public const IPV4_ADDRESS_LENGTH = 32;
/**

View File

@ -42,7 +42,7 @@ class DbMessageSource extends MessageSource
* Prefix which would be used when generating cache key.
* @deprecated This constant has never been used and will be removed in 2.1.0.
*/
const CACHE_KEY_PREFIX = 'DbMessageSource';
public const CACHE_KEY_PREFIX = 'DbMessageSource';
/**
* @var Connection|array|string the DB connection object or the application component ID of the DB connection.

View File

@ -56,27 +56,27 @@ class Formatter extends Component
/**
* @since 2.0.13
*/
const UNIT_SYSTEM_METRIC = 'metric';
public const UNIT_SYSTEM_METRIC = 'metric';
/**
* @since 2.0.13
*/
const UNIT_SYSTEM_IMPERIAL = 'imperial';
public const UNIT_SYSTEM_IMPERIAL = 'imperial';
/**
* @since 2.0.13
*/
const FORMAT_WIDTH_LONG = 'long';
public const FORMAT_WIDTH_LONG = 'long';
/**
* @since 2.0.13
*/
const FORMAT_WIDTH_SHORT = 'short';
public const FORMAT_WIDTH_SHORT = 'short';
/**
* @since 2.0.13
*/
const UNIT_LENGTH = 'length';
public const UNIT_LENGTH = 'length';
/**
* @since 2.0.13
*/
const UNIT_WEIGHT = 'mass';
public const UNIT_WEIGHT = 'mass';
/**
* @var string|null the text to be displayed when formatting a `null` value.

View File

@ -29,8 +29,8 @@ use yii\base\InvalidArgumentException;
*/
class GettextMessageSource extends MessageSource
{
const MO_FILE_EXT = '.mo';
const PO_FILE_EXT = '.po';
public const MO_FILE_EXT = '.mo';
public const PO_FILE_EXT = '.po';
/**
* @var string base directory of messages files

View File

@ -25,7 +25,7 @@ class MessageSource extends Component
/**
* @event MissingTranslationEvent an event that is triggered when a message translation is not found.
*/
const EVENT_MISSING_TRANSLATION = 'missingTranslation';
public const EVENT_MISSING_TRANSLATION = 'missingTranslation';
/**
* @var bool whether to force message translation when the source and target languages are the same.

View File

@ -45,35 +45,35 @@ class Logger extends Component
* Error message level. An error message is one that indicates the abnormal termination of the
* application and may require developer's handling.
*/
const LEVEL_ERROR = 0x01;
public const LEVEL_ERROR = 0x01;
/**
* Warning message level. A warning message is one that indicates some abnormal happens but
* the application is able to continue to run. Developers should pay attention to this message.
*/
const LEVEL_WARNING = 0x02;
public const LEVEL_WARNING = 0x02;
/**
* Informational message level. An informational message is one that includes certain information
* for developers to review.
*/
const LEVEL_INFO = 0x04;
public const LEVEL_INFO = 0x04;
/**
* Tracing message level. A tracing message is one that reveals the code execution flow.
*/
const LEVEL_TRACE = 0x08;
public const LEVEL_TRACE = 0x08;
/**
* Profiling message level. This indicates the message is for profiling purpose.
*/
const LEVEL_PROFILE = 0x40;
public const LEVEL_PROFILE = 0x40;
/**
* Profiling message level. This indicates the message is for profiling purpose. It marks the beginning
* of a profiling block.
*/
const LEVEL_PROFILE_BEGIN = 0x50;
public const LEVEL_PROFILE_BEGIN = 0x50;
/**
* Profiling message level. This indicates the message is for profiling purpose. It marks the end
* of a profiling block.
*/
const LEVEL_PROFILE_END = 0x60;
public const LEVEL_PROFILE_END = 0x60;
/**
* @var array logged messages. This property is managed by [[log()]] and [[flush()]].

View File

@ -36,11 +36,11 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont
* @event MailEvent an event raised right before send.
* You may set [[MailEvent::isValid]] to be false to cancel the send.
*/
const EVENT_BEFORE_SEND = 'beforeSend';
public const EVENT_BEFORE_SEND = 'beforeSend';
/**
* @event MailEvent an event raised right after send.
*/
const EVENT_AFTER_SEND = 'afterSend';
public const EVENT_AFTER_SEND = 'afterSend';
/**
* @var string|bool HTML layout view name. This is the layout used to render HTML mail body.

View File

@ -42,12 +42,12 @@ use yii\base\InvalidConfigException;
class OracleMutex extends DbMutex
{
/** available lock modes */
const MODE_X = 'X_MODE';
const MODE_NL = 'NL_MODE';
const MODE_S = 'S_MODE';
const MODE_SX = 'SX_MODE';
const MODE_SS = 'SS_MODE';
const MODE_SSX = 'SSX_MODE';
public const MODE_X = 'X_MODE';
public const MODE_NL = 'NL_MODE';
public const MODE_S = 'S_MODE';
public const MODE_SX = 'SX_MODE';
public const MODE_SS = 'SS_MODE';
public const MODE_SSX = 'SSX_MODE';
/**
* @var string lock mode to be used.

View File

@ -17,8 +17,8 @@ use yii\base\BaseObject;
*/
class Item extends BaseObject
{
const TYPE_ROLE = 1;
const TYPE_PERMISSION = 2;
public const TYPE_ROLE = 1;
public const TYPE_PERMISSION = 2;
/**
* @var int the type of the item. This should be either [[TYPE_ROLE]] or [[TYPE_PERMISSION]].

View File

@ -68,7 +68,7 @@ class YiiRequirementChecker
* If a string, it is treated as the path of the file, which contains the requirements;
* @return $this self instance.
*/
function check($requirements)
public function check($requirements)
{
if (is_string($requirements)) {
$requirements = require $requirements;
@ -113,7 +113,7 @@ class YiiRequirementChecker
* Performs the check for the Yii core requirements.
* @return YiiRequirementChecker self instance.
*/
function checkYii()
public function checkYii()
{
return $this->check(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'requirements.php');
}
@ -140,7 +140,7 @@ class YiiRequirementChecker
* )
* ```
*/
function getResult()
public function getResult()
{
if (isset($this->result)) {
return $this->result;
@ -153,7 +153,7 @@ class YiiRequirementChecker
* Renders the requirements check result.
* The output will vary depending is a script running from web or from console.
*/
function render()
public function render()
{
if (!isset($this->result)) {
$this->usageError('Nothing to render!');
@ -174,7 +174,7 @@ class YiiRequirementChecker
* @param string $compare comparison operator, by default '>='
* @return bool if PHP extension version matches.
*/
function checkPhpExtensionVersion($extensionName, $version, $compare = '>=')
public function checkPhpExtensionVersion($extensionName, $version, $compare = '>=')
{
if (!extension_loaded($extensionName)) {
return false;
@ -195,7 +195,7 @@ class YiiRequirementChecker
* @param string $name configuration option name.
* @return bool option is on.
*/
function checkPhpIniOn($name)
public function checkPhpIniOn($name)
{
$value = ini_get($name);
if (empty($value)) {
@ -210,7 +210,7 @@ class YiiRequirementChecker
* @param string $name configuration option name.
* @return bool option is off.
*/
function checkPhpIniOff($name)
public function checkPhpIniOff($name)
{
$value = ini_get($name);
if (empty($value)) {
@ -228,7 +228,7 @@ class YiiRequirementChecker
* @param string $compare comparison operator, by default '>='.
* @return bool comparison result.
*/
function compareByteSize($a, $b, $compare = '>=')
public function compareByteSize($a, $b, $compare = '>=')
{
$compareExpression = '(' . $this->getByteSize($a) . $compare . $this->getByteSize($b) . ')';
@ -241,7 +241,7 @@ class YiiRequirementChecker
* @param string $verboseSize verbose size representation.
* @return int actual size in bytes.
*/
function getByteSize($verboseSize)
public function getByteSize($verboseSize)
{
if (empty($verboseSize)) {
return 0;
@ -275,7 +275,7 @@ class YiiRequirementChecker
* @param string|null $max verbose file size maximum required value, pass null to skip maximum check.
* @return bool success.
*/
function checkUploadMaxFileSize($min = null, $max = null)
public function checkUploadMaxFileSize($min = null, $max = null)
{
$postMaxSize = ini_get('post_max_size');
$uploadMaxFileSize = ini_get('upload_max_filesize');
@ -302,7 +302,7 @@ class YiiRequirementChecker
* @param bool $_return_ whether the rendering result should be returned as a string
* @return string|null the rendering result. Null if the rendering result is not required.
*/
function renderViewFile($_viewFile_, $_data_ = null, $_return_ = false)
public function renderViewFile($_viewFile_, $_data_ = null, $_return_ = false)
{
// we use special variable names here to avoid conflict when extracting data
if (is_array($_data_)) {
@ -329,7 +329,7 @@ class YiiRequirementChecker
* @param int $requirementKey requirement key in the list.
* @return array normalized requirement.
*/
function normalizeRequirement($requirement, $requirementKey = 0)
public function normalizeRequirement($requirement, $requirementKey = 0)
{
if (!is_array($requirement)) {
$this->usageError('Requirement must be an array!');
@ -368,7 +368,7 @@ class YiiRequirementChecker
* This method will then terminate the execution of the current application.
* @param string $message the error message
*/
function usageError($message)
public function usageError($message)
{
echo "Error: $message\n\n";
exit(1);
@ -379,7 +379,7 @@ class YiiRequirementChecker
* @param string $expression a PHP expression to be evaluated.
* @return mixed the expression result.
*/
function evaluateExpression($expression)
public function evaluateExpression($expression)
{
return eval('return ' . $expression . ';');
}
@ -388,7 +388,7 @@ class YiiRequirementChecker
* Returns the server information.
* @return string server information.
*/
function getServerInfo()
public function getServerInfo()
{
return isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
}
@ -397,7 +397,7 @@ class YiiRequirementChecker
* Returns the now date if possible in string representation.
* @return string now date.
*/
function getNowDate()
public function getNowDate()
{
return date('Y-m-d H:i');
}

View File

@ -39,13 +39,13 @@ class CompareValidator extends Validator
* @since 2.0.11
* @see type
*/
const TYPE_STRING = 'string';
public const TYPE_STRING = 'string';
/**
* Constant for specifying the comparison [[type]] by numeric values.
* @since 2.0.11
* @see type
*/
const TYPE_NUMBER = 'number';
public const TYPE_NUMBER = 'number';
/**
* @var string the name of the attribute to be compared with. When both this property

View File

@ -41,19 +41,19 @@ class DateValidator extends Validator
* @since 2.0.8
* @see type
*/
const TYPE_DATE = 'date';
public const TYPE_DATE = 'date';
/**
* Constant for specifying the validation [[type]] as a datetime value, used for validation with intl short format.
* @since 2.0.8
* @see type
*/
const TYPE_DATETIME = 'datetime';
public const TYPE_DATETIME = 'datetime';
/**
* Constant for specifying the validation [[type]] as a time value, used for validation with intl short format.
* @since 2.0.8
* @see type
*/
const TYPE_TIME = 'time';
public const TYPE_TIME = 'time';
/**
* @var string the type of the validator. Indicates, whether a date, time or datetime value should be validated.

View File

@ -48,7 +48,7 @@ class IpValidator extends Validator
* @see networks
* @see ranges
*/
const NEGATION_CHAR = '!';
public const NEGATION_CHAR = '!';
/**
* @var array The network aliases, that can be used in [[ranges]].

View File

@ -24,7 +24,7 @@ class Cookie extends \yii\base\BaseObject
* When a user follows a link from https://otherdomain.com to https://yourdomain.com it will include the cookie
* @see sameSite
*/
const SAME_SITE_LAX = 'Lax';
public const SAME_SITE_LAX = 'Lax';
/**
* SameSite policy Strict will prevent the cookie from being sent by the browser in all cross-site browsing context
* regardless of the request method and even when following a regular link.
@ -32,7 +32,7 @@ class Cookie extends \yii\base\BaseObject
* https://otherdomain.com to https://yourdomain.com will not include the cookie.
* @see sameSite
*/
const SAME_SITE_STRICT = 'Strict';
public const SAME_SITE_STRICT = 'Strict';
/**
* SameSite policy None disables the SameSite policy so cookies will be sent in all contexts,
* i.e in responses to both first-party and cross-origin requests.
@ -42,7 +42,7 @@ class Cookie extends \yii\base\BaseObject
* @see secure
* @since 2.0.43
*/
const SAME_SITE_NONE = 'None';
public const SAME_SITE_NONE = 'None';
/**
* @var string name of the cookie

View File

@ -42,17 +42,17 @@ class JsonResponseFormatter extends Component implements ResponseFormatterInterf
* JSON Content Type
* @since 2.0.14
*/
const CONTENT_TYPE_JSONP = 'application/javascript; charset=UTF-8';
public const CONTENT_TYPE_JSONP = 'application/javascript; charset=UTF-8';
/**
* JSONP Content Type
* @since 2.0.14
*/
const CONTENT_TYPE_JSON = 'application/json; charset=UTF-8';
public const CONTENT_TYPE_JSON = 'application/json; charset=UTF-8';
/**
* HAL JSON Content Type
* @since 2.0.14
*/
const CONTENT_TYPE_HAL_JSON = 'application/hal+json; charset=UTF-8';
public const CONTENT_TYPE_HAL_JSON = 'application/hal+json; charset=UTF-8';
/**
* @var string|null custom value of the `Content-Type` header of the response.

View File

@ -20,7 +20,7 @@ class Link extends BaseObject
/**
* The self link.
*/
const REL_SELF = 'self';
public const REL_SELF = 'self';
/**
* @var string a URI [RFC3986](https://tools.ietf.org/html/rfc3986) or

View File

@ -94,12 +94,12 @@ class Request extends \yii\base\Request
/**
* Default name of the HTTP header for sending CSRF token.
*/
const CSRF_HEADER = 'X-CSRF-Token';
public const CSRF_HEADER = 'X-CSRF-Token';
/**
* The length of the CSRF token mask.
* @deprecated since 2.0.12. The mask length is now equal to the token length.
*/
const CSRF_MASK_LENGTH = 8;
public const CSRF_MASK_LENGTH = 8;
/**
* @var bool whether to enable CSRF (Cross-Site Request Forgery) validation. Defaults to true.

View File

@ -64,21 +64,21 @@ class Response extends \yii\base\Response
/**
* @event \yii\base\Event an event that is triggered at the beginning of [[send()]].
*/
const EVENT_BEFORE_SEND = 'beforeSend';
public const EVENT_BEFORE_SEND = 'beforeSend';
/**
* @event \yii\base\Event an event that is triggered at the end of [[send()]].
*/
const EVENT_AFTER_SEND = 'afterSend';
public const EVENT_AFTER_SEND = 'afterSend';
/**
* @event \yii\base\Event an event that is triggered right after [[prepare()]] is called in [[send()]].
* 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';
const FORMAT_JSONP = 'jsonp';
const FORMAT_XML = 'xml';
public const EVENT_AFTER_PREPARE = 'afterPrepare';
public const FORMAT_RAW = 'raw';
public const FORMAT_HTML = 'html';
public const FORMAT_JSON = 'json';
public const FORMAT_JSONP = 'jsonp';
public const FORMAT_XML = 'xml';
/**
* @var string the response format. This determines how to convert [[data]] into [[content]]

View File

@ -24,17 +24,17 @@ class UrlNormalizer extends BaseObject
* Represents permament redirection during route normalization.
* @see https://en.wikipedia.org/wiki/HTTP_301
*/
const ACTION_REDIRECT_PERMANENT = 301;
public const ACTION_REDIRECT_PERMANENT = 301;
/**
* Represents temporary redirection during route normalization.
* @see https://en.wikipedia.org/wiki/HTTP_302
*/
const ACTION_REDIRECT_TEMPORARY = 302;
public const ACTION_REDIRECT_TEMPORARY = 302;
/**
* Represents showing 404 error page during route normalization.
* @see https://en.wikipedia.org/wiki/HTTP_404
*/
const ACTION_NOT_FOUND = 404;
public const ACTION_NOT_FOUND = 404;
/**
* @var bool whether slashes should be collapsed, for example `site///index` will be

View File

@ -35,37 +35,37 @@ class UrlRule extends BaseObject implements UrlRuleInterface
/**
* Set [[mode]] with this value to mark that this rule is for URL parsing only.
*/
const PARSING_ONLY = 1;
public const PARSING_ONLY = 1;
/**
* Set [[mode]] with this value to mark that this rule is for URL creation only.
*/
const CREATION_ONLY = 2;
public const CREATION_ONLY = 2;
/**
* Represents the successful URL generation by last [[createUrl()]] call.
* @see createStatus
* @since 2.0.12
*/
const CREATE_STATUS_SUCCESS = 0;
public const CREATE_STATUS_SUCCESS = 0;
/**
* Represents the unsuccessful URL generation by last [[createUrl()]] call, because rule does not support
* creating URLs.
* @see createStatus
* @since 2.0.12
*/
const CREATE_STATUS_PARSING_ONLY = 1;
public const CREATE_STATUS_PARSING_ONLY = 1;
/**
* Represents the unsuccessful URL generation by last [[createUrl()]] call, because of mismatched route.
* @see createStatus
* @since 2.0.12
*/
const CREATE_STATUS_ROUTE_MISMATCH = 2;
public const CREATE_STATUS_ROUTE_MISMATCH = 2;
/**
* Represents the unsuccessful URL generation by last [[createUrl()]] call, because of mismatched
* or missing parameters.
* @see createStatus
* @since 2.0.12
*/
const CREATE_STATUS_PARAMS_MISMATCH = 4;
public const CREATE_STATUS_PARAMS_MISMATCH = 4;
/**
* @var string|null the name of this rule. If not set, it will use [[pattern]] as the name.

View File

@ -64,10 +64,10 @@ use yii\rbac\CheckAccessInterface;
*/
class User extends Component
{
const EVENT_BEFORE_LOGIN = 'beforeLogin';
const EVENT_AFTER_LOGIN = 'afterLogin';
const EVENT_BEFORE_LOGOUT = 'beforeLogout';
const EVENT_AFTER_LOGOUT = 'afterLogout';
public const EVENT_BEFORE_LOGIN = 'beforeLogin';
public const EVENT_AFTER_LOGIN = 'afterLogin';
public const EVENT_BEFORE_LOGOUT = 'beforeLogout';
public const EVENT_AFTER_LOGOUT = 'afterLogout';
/**
* @var string the class name of the [[identity]] object.

View File

@ -73,48 +73,48 @@ class View extends \yii\base\View
/**
* @event Event an event that is triggered by [[beginBody()]].
*/
const EVENT_BEGIN_BODY = 'beginBody';
public const EVENT_BEGIN_BODY = 'beginBody';
/**
* @event Event an event that is triggered by [[endBody()]].
*/
const EVENT_END_BODY = 'endBody';
public const EVENT_END_BODY = 'endBody';
/**
* The location of registered JavaScript code block or files.
* This means the location is in the head section.
*/
const POS_HEAD = 1;
public const POS_HEAD = 1;
/**
* The location of registered JavaScript code block or files.
* This means the location is at the beginning of the body section.
*/
const POS_BEGIN = 2;
public const POS_BEGIN = 2;
/**
* The location of registered JavaScript code block or files.
* This means the location is at the end of the body section.
*/
const POS_END = 3;
public const POS_END = 3;
/**
* The location of registered JavaScript code block.
* This means the JavaScript code block will be enclosed within `jQuery(document).ready()`.
*/
const POS_READY = 4;
public const POS_READY = 4;
/**
* The location of registered JavaScript code block.
* This means the JavaScript code block will be enclosed within `jQuery(window).load()`.
*/
const POS_LOAD = 5;
public const POS_LOAD = 5;
/**
* This is internally used as the placeholder for receiving the content registered for the head section.
*/
const PH_HEAD = '<![CDATA[YII-BLOCK-HEAD]]>';
public const PH_HEAD = '<![CDATA[YII-BLOCK-HEAD]]>';
/**
* This is internally used as the placeholder for receiving the content registered for the beginning of the body section.
*/
const PH_BODY_BEGIN = '<![CDATA[YII-BLOCK-BODY-BEGIN]]>';
public const PH_BODY_BEGIN = '<![CDATA[YII-BLOCK-BODY-BEGIN]]>';
/**
* This is internally used as the placeholder for receiving the content registered for the end of the body section.
*/
const PH_BODY_END = '<![CDATA[YII-BLOCK-BODY-END]]>';
public const PH_BODY_END = '<![CDATA[YII-BLOCK-BODY-END]]>';
/**
* @var AssetBundle[] list of the registered asset bundles. The keys are the bundle names, and the values

View File

@ -30,12 +30,12 @@ class ActiveForm extends Widget
* Add validation state class to container tag
* @since 2.0.14
*/
const VALIDATION_STATE_ON_CONTAINER = 'container';
public const VALIDATION_STATE_ON_CONTAINER = 'container';
/**
* Add validation state class to input tag
* @since 2.0.14
*/
const VALIDATION_STATE_ON_INPUT = 'input';
public const VALIDATION_STATE_ON_INPUT = 'input';
/**
* @var array|string the form action URL. This parameter will be processed by [[\yii\helpers\Url::to()]].

View File

@ -48,7 +48,7 @@ class MaskedInput extends InputWidget
/**
* The name of the jQuery plugin to use for this widget.
*/
const PLUGIN_NAME = 'inputmask';
public const PLUGIN_NAME = 'inputmask';
/**
* @var string|array|JsExpression the input mask (e.g. '99/99/9999' for date input). The following characters

View File

@ -1,9 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Yii2">
<rule ref="vendor/yiisoft/yii2-coding-standards/Yii2">
<!-- Yii2 framework supports PHP 5.4, constant visibility was added in PHP 7.1 -->
<exclude name="PSR12.Properties.ConstantVisibility.NotFound"/>
</rule>
<rule ref="vendor/yiisoft/yii2-coding-standards/Yii2"></rule>
<!-- display progress -->
<arg value="p"/>

View File

@ -26,8 +26,8 @@ use yiiunit\framework\db\ActiveRecordTest;
*/
class Customer extends ActiveRecord
{
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 2;
public const STATUS_ACTIVE = 1;
public const STATUS_INACTIVE = 2;
public $status2;

View File

@ -15,8 +15,8 @@ namespace yiiunit\data\ar;
*/
class CustomerWithAlias extends ActiveRecord
{
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 2;
public const STATUS_ACTIVE = 1;
public const STATUS_INACTIVE = 2;
public $status2;

View File

@ -207,7 +207,7 @@ class User extends ActiveRecord
interface SomeInterface
{
const EVENT_SUPER_EVENT = 'superEvent';
public const EVENT_SUPER_EVENT = 'superEvent';
}
class SomeClass extends Component implements SomeInterface

View File

@ -19,7 +19,7 @@ use yiiunit\TestCase;
*/
class SecurityTest extends TestCase
{
const CRYPT_VECTORS = 'old';
public const CRYPT_VECTORS = 'old';
/**
* @var ExposedSecurity

View File

@ -20,7 +20,7 @@ class DeadLockTest extends \yiiunit\framework\db\mysql\ConnectionTest
/** @var string Shared log filename for children */
private $logFile;
const CHILD_EXIT_CODE_DEADLOCK = 15;
public const CHILD_EXIT_CODE_DEADLOCK = 15;
/**
* Test deadlock exception.

View File

@ -315,9 +315,9 @@ class BoolAR extends ActiveRecord
class UserAR extends ActiveRecord
{
const STATUS_DELETED = 0;
const STATUS_ACTIVE = 10;
const ROLE_USER = 10;
public const STATUS_DELETED = 0;
public const STATUS_ACTIVE = 10;
public const ROLE_USER = 10;
public static function tableName()
{

View File

@ -17,17 +17,17 @@ use yiiunit\TestCase;
*/
class FallbackMessageFormatterTest extends TestCase
{
const N = 'n';
const N_VALUE = 42;
const F = 'f';
const F_VALUE = 2e+8;
const F_VALUE_FORMATTED = '200,000,000';
const D = 'd';
const D_VALUE = 200000000.101;
const D_VALUE_FORMATTED = '200,000,000.101';
const D_VALUE_FORMATTED_INTEGER = '200,000,000';
const SUBJECT = 'сабж';
const SUBJECT_VALUE = 'Answer to the Ultimate Question of Life, the Universe, and Everything';
public const N = 'n';
public const N_VALUE = 42;
public const F = 'f';
public const F_VALUE = 2e+8;
public const F_VALUE_FORMATTED = '200,000,000';
public const D = 'd';
public const D_VALUE = 200000000.101;
public const D_VALUE_FORMATTED = '200,000,000.101';
public const D_VALUE_FORMATTED_INTEGER = '200,000,000';
public const SUBJECT = 'сабж';
public const SUBJECT_VALUE = 'Answer to the Ultimate Question of Life, the Universe, and Everything';
public function patterns()
{

View File

@ -17,17 +17,17 @@ use yiiunit\TestCase;
*/
class MessageFormatterTest extends TestCase
{
const N = 'n';
const N_VALUE = 42;
const F = 'f';
const F_VALUE = 2e+8;
const F_VALUE_FORMATTED = '200,000,000';
const D = 'd';
const D_VALUE = 200000000.101;
const D_VALUE_FORMATTED = '200,000,000.101';
const D_VALUE_FORMATTED_INTEGER = '200,000,000';
const SUBJECT = 'сабж';
const SUBJECT_VALUE = 'Answer to the Ultimate Question of Life, the Universe, and Everything';
public const N = 'n';
public const N_VALUE = 42;
public const F = 'f';
public const F_VALUE = 2e+8;
public const F_VALUE_FORMATTED = '200,000,000';
public const D = 'd';
public const D_VALUE = 200000000.101;
public const D_VALUE_FORMATTED = '200,000,000.101';
public const D_VALUE_FORMATTED_INTEGER = '200,000,000';
public const SUBJECT = 'сабж';
public const SUBJECT_VALUE = 'Answer to the Ultimate Question of Life, the Universe, and Everything';
public function patterns()
{