Skip to content

Commit

Permalink
Add class constant visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Dec 11, 2024
1 parent 1dd04fc commit f2e7289
Show file tree
Hide file tree
Showing 27 changed files with 98 additions and 98 deletions.
6 changes: 3 additions & 3 deletions modules/backend/behaviors/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ class FormController extends ControllerBehavior
/**
* @var string Default context for "create" pages.
*/
const CONTEXT_CREATE = 'create';
public const CONTEXT_CREATE = 'create';

/**
* @var string Default context for "update" pages.
*/
const CONTEXT_UPDATE = 'update';
public const CONTEXT_UPDATE = 'update';

/**
* @var string Default context for "preview" pages.
*/
const CONTEXT_PREVIEW = 'preview';
public const CONTEXT_PREVIEW = 'preview';

/**
* @var \Backend\Classes\Controller|FormController Reference to the back end controller.
Expand Down
6 changes: 3 additions & 3 deletions modules/backend/behaviors/RelationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ class RelationController extends ControllerBehavior
/**
* @var const Postback parameter for the active relationship field.
*/
const PARAM_FIELD = '_relation_field';
public const PARAM_FIELD = '_relation_field';

/**
* @var const Postback parameter for the active management mode.
*/
const PARAM_MODE = '_relation_mode';
public const PARAM_MODE = '_relation_mode';

/**
* @var const Postback parameter for read only mode.
*/
const PARAM_EXTRA_CONFIG = '_relation_extra_config';
public const PARAM_EXTRA_CONFIG = '_relation_extra_config';

/**
* @var Backend\Widgets\Search Reference to the search widget object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class TranscodeFilter extends php_user_filter
{
const FILTER_NAME = 'winter.csv.transcode.';
public const FILTER_NAME = 'winter.csv.transcode.';

protected $encodingFrom = 'auto';

Expand Down
4 changes: 2 additions & 2 deletions modules/backend/classes/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class FormField
/**
* @var int Value returned when the form field should not contribute any save data.
*/
const NO_SAVE_DATA = -1;
public const NO_SAVE_DATA = -1;

/**
* @var string A special character in yaml config files to indicate a field higher in hierarchy
*/
const HIERARCHY_UP = '^';
public const HIERARCHY_UP = '^';

/**
* @var string Form field name.
Expand Down
6 changes: 3 additions & 3 deletions modules/backend/classes/FormTabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
class FormTabs implements IteratorAggregate, ArrayAccess
{
const SECTION_OUTSIDE = 'outside';
const SECTION_PRIMARY = 'primary';
const SECTION_SECONDARY = 'secondary';
public const SECTION_OUTSIDE = 'outside';
public const SECTION_PRIMARY = 'primary';
public const SECTION_SECONDARY = 'secondary';

/**
* @var string Specifies the form section these tabs belong to.
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/formwidgets/ColorPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class ColorPicker extends FormWidgetBase
{
// All color formats supported
const ALL_FORMATS = ['cmyk', 'hex', 'hsl', 'rgb'];
public const ALL_FORMATS = ['cmyk', 'hex', 'hsl', 'rgb'];

//
// Configurable properties
Expand Down
6 changes: 3 additions & 3 deletions modules/backend/formwidgets/TagList.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class TagList extends FormWidgetBase
{
use \Backend\Traits\FormModelWidget;

const MODE_ARRAY = 'array';
const MODE_STRING = 'string';
const MODE_RELATION = 'relation';
public const MODE_ARRAY = 'array';
public const MODE_STRING = 'string';
public const MODE_RELATION = 'relation';

//
// Configurable properties
Expand Down
12 changes: 6 additions & 6 deletions modules/backend/models/BrandSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class BrandSetting extends Model
*/
public $cacheKey = 'backend::brand.custom_css';

const PRIMARY_COLOR = '#34495e'; // Wet Asphalt
const SECONDARY_COLOR = '#e67e22'; // Pumpkin
const ACCENT_COLOR = '#3498db'; // Peter River
public const PRIMARY_COLOR = '#34495e'; // Wet Asphalt
public const SECONDARY_COLOR = '#e67e22'; // Pumpkin
public const ACCENT_COLOR = '#3498db'; // Peter River

const INLINE_MENU = 'inline';
const TILE_MENU = 'tile';
const COLLAPSE_MENU = 'collapse';
public const INLINE_MENU = 'inline';
public const TILE_MENU = 'tile';
public const COLLAPSE_MENU = 'collapse';

/**
* Validation rules
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/models/Preference.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Preference extends Model
{
use \Winter\Storm\Database\Traits\Validation;

const DEFAULT_THEME = 'twilight';
public const DEFAULT_THEME = 'twilight';

/**
* @var array Behaviors implemented by this model.
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/models/UserGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class UserGroup extends GroupBase
{
const CODE_OWNERS = 'owners';
public const CODE_OWNERS = 'owners';

/**
* @var string The database table used by the model.
Expand Down
4 changes: 2 additions & 2 deletions modules/backend/models/UserRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
class UserRole extends RoleBase
{
const CODE_DEVELOPER = 'developer';
const CODE_PUBLISHER = 'publisher';
public const CODE_DEVELOPER = 'developer';
public const CODE_PUBLISHER = 'publisher';

/**
* @var string The database table used by the model.
Expand Down
16 changes: 8 additions & 8 deletions modules/backend/widgets/MediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ class MediaManager extends WidgetBase
use \Backend\Traits\UploadableWidget;
use \Backend\Traits\PreferenceMaker;

const FOLDER_ROOT = '/';
public const FOLDER_ROOT = '/';

const VIEW_MODE_GRID = 'grid';
const VIEW_MODE_LIST = 'list';
const VIEW_MODE_TILES = 'tiles';
public const VIEW_MODE_GRID = 'grid';
public const VIEW_MODE_LIST = 'list';
public const VIEW_MODE_TILES = 'tiles';

const SELECTION_MODE_NORMAL = 'normal';
const SELECTION_MODE_FIXED_RATIO = 'fixed-ratio';
const SELECTION_MODE_FIXED_SIZE = 'fixed-size';
public const SELECTION_MODE_NORMAL = 'normal';
public const SELECTION_MODE_FIXED_RATIO = 'fixed-ratio';
public const SELECTION_MODE_FIXED_SIZE = 'fixed-size';

const FILTER_ALL = 'all';
public const FILTER_ALL = 'all';

/**
* @var boolean Determines whether the widget is in readonly mode or not.
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/widgets/form/partials/_field_range.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<span style="position: absolute; transform: translateX(-50%)"></span>
<script>
(() => {
const input = document.getElementById("<?= $field->getId() ?>");
public const input = document.getElementById("<?= $field->getId() ?>");
input.addEventListener("input", function () {
this.nextElementSibling.innerHTML = this.value;
var pos = ((this.value - <?= $min ?>) / (<?= $max ?> - <?= $min ?>) * 100);
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/classes/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Layout extends CmsCompoundObject
/**
* Fallback layout name.
*/
const FALLBACK_FILE_NAME = 'fallback';
public const FALLBACK_FILE_NAME = 'fallback';

/**
* @var string The container name associated with the model, eg: pages.
Expand Down
4 changes: 2 additions & 2 deletions modules/cms/classes/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class Theme extends CmsObject
*/
protected $defaultExtension = 'yaml';

const ACTIVE_KEY = 'cms::theme.active';
const EDIT_KEY = 'cms::theme.edit';
public const ACTIVE_KEY = 'cms::theme.active';
public const EDIT_KEY = 'cms::theme.edit';

/**
* Loads the theme.
Expand Down
6 changes: 3 additions & 3 deletions modules/cms/models/ThemeLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
class ThemeLog extends Model
{
const TYPE_CREATE = 'create';
const TYPE_UPDATE = 'update';
const TYPE_DELETE = 'delete';
public const TYPE_CREATE = 'create';
public const TYPE_UPDATE = 'update';
public const TYPE_DELETE = 'delete';

/**
* @var string The database table used by the model.
Expand Down
8 changes: 4 additions & 4 deletions modules/cms/twig/DebugExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

class DebugExtension extends TwigExtension
{
const PAGE_CAPTION = 'Page variables';
const ARRAY_CAPTION = 'Array variables';
const OBJECT_CAPTION = 'Object variables';
const COMPONENT_CAPTION = 'Component variables';
public const PAGE_CAPTION = 'Page variables';
public const ARRAY_CAPTION = 'Array variables';
public const OBJECT_CAPTION = 'Object variables';
public const COMPONENT_CAPTION = 'Component variables';

/**
* @var integer Helper for rendering table row styles.
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/widgets/TemplateList.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TemplateList extends WidgetBase
use \Backend\Traits\SelectableWidget;
use \Backend\Traits\CollapsableWidget;

const SORTING_FILENAME = 'fileName';
public const SORTING_FILENAME = 'fileName';

protected $searchTerm = false;

Expand Down
6 changes: 3 additions & 3 deletions modules/system/classes/MarkupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class MarkupManager
{
use \Winter\Storm\Support\Traits\Singleton;

const EXTENSION_FILTER = 'filters';
const EXTENSION_FUNCTION = 'functions';
const EXTENSION_TOKEN_PARSER = 'tokens';
public const EXTENSION_FILTER = 'filters';
public const EXTENSION_FUNCTION = 'functions';
public const EXTENSION_TOKEN_PARSER = 'tokens';

/**
* @var array Cache of registration callbacks.
Expand Down
10 changes: 5 additions & 5 deletions modules/system/classes/MediaLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class MediaLibrary
{
use \Winter\Storm\Support\Traits\Singleton;

const SORT_BY_TITLE = 'title';
const SORT_BY_SIZE = 'size';
const SORT_BY_MODIFIED = 'modified';
const SORT_DIRECTION_ASC = 'asc';
const SORT_DIRECTION_DESC = 'desc';
public const SORT_BY_TITLE = 'title';
public const SORT_BY_SIZE = 'size';
public const SORT_BY_MODIFIED = 'modified';
public const SORT_DIRECTION_ASC = 'asc';
public const SORT_DIRECTION_DESC = 'desc';

/**
* @var string Cache key
Expand Down
12 changes: 6 additions & 6 deletions modules/system/classes/MediaLibraryItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
class MediaLibraryItem
{
const TYPE_FILE = 'file';
const TYPE_FOLDER = 'folder';
public const TYPE_FILE = 'file';
public const TYPE_FOLDER = 'folder';

const FILE_TYPE_IMAGE = 'image';
const FILE_TYPE_VIDEO = 'video';
const FILE_TYPE_AUDIO = 'audio';
const FILE_TYPE_DOCUMENT = 'document';
public const FILE_TYPE_IMAGE = 'image';
public const FILE_TYPE_VIDEO = 'video';
public const FILE_TYPE_AUDIO = 'audio';
public const FILE_TYPE_DOCUMENT = 'document';

/**
* @var string Specifies the item path relative to the Library root.
Expand Down
28 changes: 14 additions & 14 deletions modules/system/classes/SettingsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ class SettingsManager
/**
* Allocated category types
*/
const CATEGORY_CMS = 'system::lang.system.categories.cms';
const CATEGORY_MISC = 'system::lang.system.categories.misc';
const CATEGORY_MAIL = 'system::lang.system.categories.mail';
const CATEGORY_LOGS = 'system::lang.system.categories.logs';
const CATEGORY_SHOP = 'system::lang.system.categories.shop';
const CATEGORY_TEAM = 'system::lang.system.categories.team';
const CATEGORY_USERS = 'system::lang.system.categories.users';
const CATEGORY_SOCIAL = 'system::lang.system.categories.social';
const CATEGORY_SYSTEM = 'system::lang.system.categories.system';
const CATEGORY_EVENTS = 'system::lang.system.categories.events';
const CATEGORY_BACKEND = 'system::lang.system.categories.backend';
const CATEGORY_CUSTOMERS = 'system::lang.system.categories.customers';
const CATEGORY_MYSETTINGS = 'system::lang.system.categories.my_settings';
const CATEGORY_NOTIFICATIONS = 'system::lang.system.categories.notifications';
public const CATEGORY_CMS = 'system::lang.system.categories.cms';
public const CATEGORY_MISC = 'system::lang.system.categories.misc';
public const CATEGORY_MAIL = 'system::lang.system.categories.mail';
public const CATEGORY_LOGS = 'system::lang.system.categories.logs';
public const CATEGORY_SHOP = 'system::lang.system.categories.shop';
public const CATEGORY_TEAM = 'system::lang.system.categories.team';
public const CATEGORY_USERS = 'system::lang.system.categories.users';
public const CATEGORY_SOCIAL = 'system::lang.system.categories.social';
public const CATEGORY_SYSTEM = 'system::lang.system.categories.system';
public const CATEGORY_EVENTS = 'system::lang.system.categories.events';
public const CATEGORY_BACKEND = 'system::lang.system.categories.backend';
public const CATEGORY_CUSTOMERS = 'system::lang.system.categories.customers';
public const CATEGORY_MYSETTINGS = 'system::lang.system.categories.my_settings';
public const CATEGORY_NOTIFICATIONS = 'system::lang.system.categories.notifications';

/**
* @var array Cache of registration callbacks.
Expand Down
6 changes: 3 additions & 3 deletions modules/system/classes/VersionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class VersionManager
/**
* Value when no updates are found.
*/
const NO_VERSION_VALUE = 0;
public const NO_VERSION_VALUE = 0;

/**
* Morph types for history table.
*/
const HISTORY_TYPE_COMMENT = 'comment';
const HISTORY_TYPE_SCRIPT = 'script';
public const HISTORY_TYPE_COMMENT = 'comment';
public const HISTORY_TYPE_SCRIPT = 'script';

/**
* @var \Illuminate\Console\OutputStyle
Expand Down
2 changes: 1 addition & 1 deletion modules/system/console/asset/npm/NpmVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class NpmVersion extends NpmCommand
{
const NPM_MINIMUM_SUPPORTED_VERSION = '7.0';
public const NPM_MINIMUM_SUPPORTED_VERSION = '7.0';

/**
* @var string|null The default command name for lazy loading.
Expand Down
24 changes: 12 additions & 12 deletions modules/system/models/MailBrandSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ class MailBrandSetting extends Model
*/
public $cacheKey = 'system::mailbrand.custom_css';

const WHITE_COLOR = '#fff';
const BODY_BG = '#f5f8fa';
const PRIMARY_BG = '#3498db';
const POSITIVE_BG = '#31ac5f';
const NEGATIVE_BG = '#ab2a1c';
const HEADER_COLOR = '#bbbfc3';
const HEADING_COLOR = '#2f3133';
const TEXT_COLOR = '#74787e';
const LINK_COLOR = '#0181b9';
const FOOTER_COLOR = '#aeaeae';
const BORDER_COLOR = '#edeff2';
const PROMOTION_BORDER_COLOR = '#9ba2ab';
public const WHITE_COLOR = '#fff';
public const BODY_BG = '#f5f8fa';
public const PRIMARY_BG = '#3498db';
public const POSITIVE_BG = '#31ac5f';
public const NEGATIVE_BG = '#ab2a1c';
public const HEADER_COLOR = '#bbbfc3';
public const HEADING_COLOR = '#2f3133';
public const TEXT_COLOR = '#74787e';
public const LINK_COLOR = '#0181b9';
public const FOOTER_COLOR = '#aeaeae';
public const BORDER_COLOR = '#edeff2';
public const PROMOTION_BORDER_COLOR = '#9ba2ab';

/**
* Validation rules
Expand Down
8 changes: 4 additions & 4 deletions modules/system/models/MailSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class MailSetting extends Model
{
use \Winter\Storm\Database\Traits\Validation;

const MODE_LOG = 'log';
const MODE_MAIL = 'mail';
const MODE_SENDMAIL = 'sendmail';
const MODE_SMTP = 'smtp';
public const MODE_LOG = 'log';
public const MODE_MAIL = 'mail';
public const MODE_SENDMAIL = 'sendmail';
public const MODE_SMTP = 'smtp';

/**
* @var array Behaviors implemented by this model.
Expand Down
Loading

0 comments on commit f2e7289

Please sign in to comment.