Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/controllers/ReleaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,8 @@ protected function getCurrentVersions(array $what)
return $versions;
}

const MINOR = 'minor';
const PATCH = 'patch';
public const MINOR = 'minor';
public const PATCH = 'patch';

protected function getNextVersions(array $versions, $type)
{
Expand Down
18 changes: 9 additions & 9 deletions framework/base/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions framework/base/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion framework/base/ErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)


/**
Expand Down
2 changes: 1 addition & 1 deletion framework/base/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions framework/base/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions framework/base/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
8 changes: 4 additions & 4 deletions framework/base/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions framework/base/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions framework/behaviors/AttributeTypecastBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
*/
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.
Expand Down
2 changes: 1 addition & 1 deletion framework/captcha/CaptchaAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion framework/console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions framework/console/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
34 changes: 17 additions & 17 deletions framework/console/ExitCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion framework/console/controllers/BaseMigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion framework/console/controllers/MigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions framework/console/controllers/ServeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*/
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.
Expand Down
34 changes: 17 additions & 17 deletions framework/console/widgets/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@
*/
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
Expand Down
Loading
Loading