Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coding Style] Enable rule PSR12.Properties.ConstantVisibility #22131

Merged
merged 2 commits into from
Apr 18, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions core/API/DataTableManipulator/LabelFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
*/
class LabelFilter extends DataTableManipulator
{
const SEPARATOR_RECURSIVE_LABEL = '>';
const TERMINAL_OPERATOR = '@';
const FLAG_IS_ROW_EVOLUTION = 'label_index';
public const SEPARATOR_RECURSIVE_LABEL = '>';
public const TERMINAL_OPERATOR = '@';
public const FLAG_IS_ROW_EVOLUTION = 'label_index';

private $labels;
private $addLabelIndex;
Expand Down
2 changes: 1 addition & 1 deletion core/API/DataTablePostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
class DataTablePostProcessor
{
const PROCESSED_METRICS_COMPUTED_FLAG = 'processed_metrics_computed';
public const PROCESSED_METRICS_COMPUTED_FLAG = 'processed_metrics_computed';

/**
* @var null|Report
Expand Down
6 changes: 3 additions & 3 deletions core/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
*/
class Archive implements ArchiveQuery
{
const REQUEST_ALL_WEBSITES_FLAG = 'all';
const ARCHIVE_ALL_PLUGINS_FLAG = 'all';
const ID_SUBTABLE_LOAD_ALL_SUBTABLES = 'all';
public const REQUEST_ALL_WEBSITES_FLAG = 'all';
public const ARCHIVE_ALL_PLUGINS_FLAG = 'all';
public const ID_SUBTABLE_LOAD_ALL_SUBTABLES = 'all';

/**
* List of archive IDs for the site, periods and segment we are querying with.
Expand Down
6 changes: 3 additions & 3 deletions core/Archive/ArchiveInvalidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
*/
class ArchiveInvalidator
{
const TRACKER_CACHE_KEY = 'ArchiveInvalidator.rememberToInvalidate';
public const TRACKER_CACHE_KEY = 'ArchiveInvalidator.rememberToInvalidate';

const INVALIDATION_STATUS_QUEUED = 0;
const INVALIDATION_STATUS_IN_PROGRESS = 1;
public const INVALIDATION_STATUS_QUEUED = 0;
public const INVALIDATION_STATUS_IN_PROGRESS = 1;

private $rememberArchivedReportIdStart = 'report_to_invalidate_';

Expand Down
4 changes: 2 additions & 2 deletions core/Archive/Chunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
class Chunk
{
const ARCHIVE_APPENDIX_SUBTABLES = 'chunk';
const NUM_TABLES_IN_CHUNK = 100;
public const ARCHIVE_APPENDIX_SUBTABLES = 'chunk';
public const NUM_TABLES_IN_CHUNK = 100;

/**
* Gets the record name to use for a given tableId/subtableId.
Expand Down
2 changes: 1 addition & 1 deletion core/Archive/DataCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class DataCollection
{
const METADATA_CONTAINER_ROW_KEY = '_metadata';
public const METADATA_CONTAINER_ROW_KEY = '_metadata';

/**
* The archive data, indexed first by site ID and then by period date range. Eg,
Expand Down
8 changes: 4 additions & 4 deletions core/Archive/DataTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/
class DataTableFactory
{
const TABLE_METADATA_SEGMENT_INDEX = 'segment';
const TABLE_METADATA_SEGMENT_PRETTY_INDEX = 'segmentPretty';
public const TABLE_METADATA_SEGMENT_INDEX = 'segment';
public const TABLE_METADATA_SEGMENT_PRETTY_INDEX = 'segmentPretty';

/**
* @see DataCollection::$dataNames.
Expand Down Expand Up @@ -87,8 +87,8 @@ class DataTableFactory
*/
private $defaultRow;

const TABLE_METADATA_SITE_INDEX = 'site';
const TABLE_METADATA_PERIOD_INDEX = 'period';
public const TABLE_METADATA_SITE_INDEX = 'site';
public const TABLE_METADATA_PERIOD_INDEX = 'period';

/**
* Constructor.
Expand Down
4 changes: 2 additions & 2 deletions core/ArchiveProcessor/ArchivingStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class ArchivingStatus
{
const LOCK_KEY_PREFIX = 'Archiving';
const DEFAULT_ARCHIVING_TTL = 7200; // 2 hours
public const LOCK_KEY_PREFIX = 'Archiving';
public const DEFAULT_ARCHIVING_TTL = 7200; // 2 hours

/**
* @var LockBackend
Expand Down
4 changes: 2 additions & 2 deletions core/ArchiveProcessor/LoaderLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class LoaderLock
{
const MAX_LEN_LOCK_NAME = 64;
const MAX_LOCK_TIME = 60; //in seconds
public const MAX_LEN_LOCK_NAME = 64;
public const MAX_LOCK_TIME = 60; //in seconds
protected $id;

/**
Expand Down
4 changes: 2 additions & 2 deletions core/ArchiveProcessor/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
class Record
{
const TYPE_NUMERIC = 'numeric';
const TYPE_BLOB = 'blob';
public const TYPE_NUMERIC = 'numeric';
public const TYPE_BLOB = 'blob';

/**
* @var string
Expand Down
6 changes: 3 additions & 3 deletions core/ArchiveProcessor/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
*/
class Rules
{
const OPTION_TODAY_ARCHIVE_TTL = 'todayArchiveTimeToLive';
public const OPTION_TODAY_ARCHIVE_TTL = 'todayArchiveTimeToLive';

const OPTION_BROWSER_TRIGGER_ARCHIVING = 'enableBrowserTriggerArchiving';
public const OPTION_BROWSER_TRIGGER_ARCHIVING = 'enableBrowserTriggerArchiving';

const FLAG_TABLE_PURGED = 'lastPurge_';
public const FLAG_TABLE_PURGED = 'lastPurge_';

/** Flag that will forcefully disable the archiving process (used in tests only) */
public static $archivingDisabledByTests = false;
Expand Down
2 changes: 1 addition & 1 deletion core/Archiver/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Request
* If a request is aborted, the response of a CliMutli job will be a serialized array containing the
* key/value "aborted => 1".
*/
const ABORT = 'abort';
public const ABORT = 'abort';

/**
* @var string
Expand Down
22 changes: 11 additions & 11 deletions core/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
*/
class AssetManager extends Singleton
{
const MERGED_CSS_FILE = "asset_manager_global_css.css";
const MERGED_CORE_JS_FILE = "asset_manager_core_js.js";
const MERGED_NON_CORE_JS_FILE = "asset_manager_non_core_js.js";

const CSS_IMPORT_DIRECTIVE = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n";
const JS_IMPORT_DIRECTIVE = "<script type=\"text/javascript\" src=\"%s\"></script>\n";
const JS_DEFER_IMPORT_DIRECTIVE = "<script type=\"text/javascript\" src=\"%s\" defer></script>\n";
const GET_CSS_MODULE_ACTION = "index.php?module=Proxy&action=getCss";
const GET_CORE_JS_MODULE_ACTION = "index.php?module=Proxy&action=getCoreJs";
const GET_NON_CORE_JS_MODULE_ACTION = "index.php?module=Proxy&action=getNonCoreJs";
const GET_JS_UMD_MODULE_ACTION = "index.php?module=Proxy&action=getUmdJs&chunk=";
public const MERGED_CSS_FILE = "asset_manager_global_css.css";
public const MERGED_CORE_JS_FILE = "asset_manager_core_js.js";
public const MERGED_NON_CORE_JS_FILE = "asset_manager_non_core_js.js";

public const CSS_IMPORT_DIRECTIVE = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n";
public const JS_IMPORT_DIRECTIVE = "<script type=\"text/javascript\" src=\"%s\"></script>\n";
public const JS_DEFER_IMPORT_DIRECTIVE = "<script type=\"text/javascript\" src=\"%s\" defer></script>\n";
public const GET_CSS_MODULE_ACTION = "index.php?module=Proxy&action=getCss";
public const GET_CORE_JS_MODULE_ACTION = "index.php?module=Proxy&action=getCoreJs";
public const GET_NON_CORE_JS_MODULE_ACTION = "index.php?module=Proxy&action=getNonCoreJs";
public const GET_JS_UMD_MODULE_ACTION = "index.php?module=Proxy&action=getUmdJs&chunk=";

/**
* @var UIAssetCacheBuster
Expand Down
2 changes: 1 addition & 1 deletion core/AssetManager/UIAssetMinifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class UIAssetMinifier extends Singleton
{
const MINIFIED_JS_RATIO = 100;
public const MINIFIED_JS_RATIO = 100;

protected function __construct()
{
Expand Down
6 changes: 3 additions & 3 deletions core/AuthResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
class AuthResult
{
const FAILURE = 0;
const SUCCESS = 1;
const SUCCESS_SUPERUSER_AUTH_CODE = 42;
public const FAILURE = 0;
public const SUCCESS = 1;
public const SUCCESS_SUPERUSER_AUTH_CODE = 42;

/**
* token_auth parameter used to authenticate in the API
Expand Down
6 changes: 3 additions & 3 deletions core/Changes/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
*/
class Model
{
const NO_CHANGES_EXIST = 0;
const CHANGES_EXIST = 1;
const NEW_CHANGES_EXIST = 2;
public const NO_CHANGES_EXIST = 0;
public const CHANGES_EXIST = 1;
public const NEW_CHANGES_EXIST = 2;

/**
* @var Db\AdapterInterface
Expand Down
2 changes: 1 addition & 1 deletion core/CliMulti.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class CliMulti
{
const BASE_WAIT_TIME = 250000; // 250 * 1000 = 250ms
public const BASE_WAIT_TIME = 250000; // 250 * 1000 = 250ms

/**
* If set to true or false it will overwrite whether async is supported or not.
Expand Down
4 changes: 2 additions & 2 deletions core/CliMulti/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
*/
class Process
{
const PS_COMMAND = 'ps x';
const AWK_COMMAND = 'awk \'! /defunct/ {print $1}\'';
public const PS_COMMAND = 'ps x';
public const AWK_COMMAND = 'awk \'! /defunct/ {print $1}\'';

private $finished = null;
private $pidFile = '';
Expand Down
36 changes: 18 additions & 18 deletions core/Columns/Dimension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@
*/
abstract class Dimension
{
const COMPONENT_SUBNAMESPACE = 'Columns';
public const COMPONENT_SUBNAMESPACE = 'Columns';

/**
* Segment type 'dimension'. Can be used along with {@link setType()}.
* @api
*/
const TYPE_DIMENSION = 'dimension';
const TYPE_BINARY = 'binary';
const TYPE_TEXT = 'text';
const TYPE_ENUM = 'enum';
const TYPE_MONEY = 'money';
const TYPE_BYTE = 'byte';
const TYPE_DURATION_MS = 'duration_ms';
const TYPE_DURATION_S = 'duration_s';
const TYPE_NUMBER = 'number';
const TYPE_FLOAT = 'float';
const TYPE_URL = 'url';
const TYPE_DATE = 'date';
const TYPE_TIME = 'time';
const TYPE_DATETIME = 'datetime';
const TYPE_TIMESTAMP = 'timestamp';
const TYPE_BOOL = 'bool';
const TYPE_PERCENT = 'percent';
public const TYPE_DIMENSION = 'dimension';
public const TYPE_BINARY = 'binary';
public const TYPE_TEXT = 'text';
public const TYPE_ENUM = 'enum';
public const TYPE_MONEY = 'money';
public const TYPE_BYTE = 'byte';
public const TYPE_DURATION_MS = 'duration_ms';
public const TYPE_DURATION_S = 'duration_s';
public const TYPE_NUMBER = 'number';
public const TYPE_FLOAT = 'float';
public const TYPE_URL = 'url';
public const TYPE_DATE = 'date';
public const TYPE_TIME = 'time';
public const TYPE_DATETIME = 'datetime';
public const TYPE_TIMESTAMP = 'timestamp';
public const TYPE_BOOL = 'bool';
public const TYPE_PERCENT = 'percent';

/**
* This will be the name of the column in the database table if a $columnType is specified.
Expand Down
14 changes: 7 additions & 7 deletions core/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
class Common
{
// constants used to map the referrer type to an integer in the log_visit table
const REFERRER_TYPE_DIRECT_ENTRY = 1;
const REFERRER_TYPE_SEARCH_ENGINE = 2;
const REFERRER_TYPE_WEBSITE = 3;
const REFERRER_TYPE_CAMPAIGN = 6;
const REFERRER_TYPE_SOCIAL_NETWORK = 7;
public const REFERRER_TYPE_DIRECT_ENTRY = 1;
public const REFERRER_TYPE_SEARCH_ENGINE = 2;
public const REFERRER_TYPE_WEBSITE = 3;
public const REFERRER_TYPE_CAMPAIGN = 6;
public const REFERRER_TYPE_SOCIAL_NETWORK = 7;

// Flag used with htmlspecialchar. See php.net/htmlspecialchars.
const HTML_ENCODING_QUOTE_STYLE = ENT_QUOTES;
public const HTML_ENCODING_QUOTE_STYLE = ENT_QUOTES;

public static $isCliMode = null;

/*
* Database
*/
const LANGUAGE_CODE_INVALID = 'xx';
public const LANGUAGE_CODE_INVALID = 'xx';

/**
* Hashes a string into an integer which should be very low collision risks
Expand Down
4 changes: 2 additions & 2 deletions core/Concurrency/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class Lock
{
const MAX_KEY_LEN = 70;
const DEFAULT_TTL = 60;
public const MAX_KEY_LEN = 70;
public const DEFAULT_TTL = 60;

/**
* @var LockBackend
Expand Down
2 changes: 1 addition & 1 deletion core/Concurrency/LockBackend/MySqlLockBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class MySqlLockBackend implements LockBackend
{
const TABLE_NAME = 'locks';
public const TABLE_NAME = 'locks';

/**
* fyi: does not support list keys at the moment just because not really needed so much just yet
Expand Down
6 changes: 3 additions & 3 deletions core/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
*/
class Config
{
const DEFAULT_LOCAL_CONFIG_PATH = '/config/config.ini.php';
const DEFAULT_COMMON_CONFIG_PATH = '/config/common.config.ini.php';
const DEFAULT_GLOBAL_CONFIG_PATH = '/config/global.ini.php';
public const DEFAULT_LOCAL_CONFIG_PATH = '/config/config.ini.php';
public const DEFAULT_COMMON_CONFIG_PATH = '/config/common.config.ini.php';
public const DEFAULT_GLOBAL_CONFIG_PATH = '/config/global.ini.php';

/**
* @var boolean
Expand Down
2 changes: 1 addition & 1 deletion core/Config/IniFileChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
class IniFileChain
{
const CONFIG_CACHE_KEY = 'config.ini';
public const CONFIG_CACHE_KEY = 'config.ini';
/**
* Maps INI file names with their parsed contents. The order of the files signifies the order
* in the chain. Files with lower index are overwritten/merged with files w/ a higher index.
Expand Down
4 changes: 2 additions & 2 deletions core/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Cookie
/**
* Don't create a cookie bigger than 1k
*/
const MAX_COOKIE_SIZE = 1024;
public const MAX_COOKIE_SIZE = 1024;

/**
* The name of the cookie
Expand Down Expand Up @@ -76,7 +76,7 @@ class Cookie
/**
* The character used to separate the tuple name=value in the cookie
*/
const VALUE_SEPARATOR = ':';
public const VALUE_SEPARATOR = ':';

/**
* Instantiate a new Cookie object and tries to load the cookie content if the cookie
Expand Down
Loading
Loading