From 31dca55dd4e218e4c966e1e3f6b4913032a09238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20de=20Guillebon?= Date: Thu, 14 Dec 2023 15:56:01 +0100 Subject: [PATCH] refactor: configure visibility on constants (#1096) Co-authored-by: Nicolas Potier --- Grid/Column/Column.php | 52 ++++++++++++++++---------------- Grid/Column/MassActionColumn.php | 2 +- Grid/Columns.php | 2 +- Grid/GridManager.php | 4 +-- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Grid/Column/Column.php b/Grid/Column/Column.php index 3e9828ff..2ad3f81f 100644 --- a/Grid/Column/Column.php +++ b/Grid/Column/Column.php @@ -19,33 +19,33 @@ abstract class Column { - const DEFAULT_VALUE = null; + public const DEFAULT_VALUE = null; /** * Filter. */ - const DATA_CONJUNCTION = 0; - const DATA_DISJUNCTION = 1; - - const OPERATOR_EQ = 'eq'; - const OPERATOR_NEQ = 'neq'; - const OPERATOR_LT = 'lt'; - const OPERATOR_LTE = 'lte'; - const OPERATOR_GT = 'gt'; - const OPERATOR_GTE = 'gte'; - const OPERATOR_BTW = 'btw'; - const OPERATOR_BTWE = 'btwe'; - const OPERATOR_LIKE = 'like'; - const OPERATOR_NLIKE = 'nlike'; - const OPERATOR_RLIKE = 'rlike'; - const OPERATOR_LLIKE = 'llike'; - const OPERATOR_SLIKE = 'slike'; //simple/strict LIKE - const OPERATOR_NSLIKE = 'nslike'; - const OPERATOR_RSLIKE = 'rslike'; - const OPERATOR_LSLIKE = 'lslike'; - - const OPERATOR_ISNULL = 'isNull'; - const OPERATOR_ISNOTNULL = 'isNotNull'; + public const DATA_CONJUNCTION = 0; + public const DATA_DISJUNCTION = 1; + + public const OPERATOR_EQ = 'eq'; + public const OPERATOR_NEQ = 'neq'; + public const OPERATOR_LT = 'lt'; + public const OPERATOR_LTE = 'lte'; + public const OPERATOR_GT = 'gt'; + public const OPERATOR_GTE = 'gte'; + public const OPERATOR_BTW = 'btw'; + public const OPERATOR_BTWE = 'btwe'; + public const OPERATOR_LIKE = 'like'; + public const OPERATOR_NLIKE = 'nlike'; + public const OPERATOR_RLIKE = 'rlike'; + public const OPERATOR_LLIKE = 'llike'; + public const OPERATOR_SLIKE = 'slike'; //simple/strict LIKE + public const OPERATOR_NSLIKE = 'nslike'; + public const OPERATOR_RSLIKE = 'rslike'; + public const OPERATOR_LSLIKE = 'lslike'; + + public const OPERATOR_ISNULL = 'isNull'; + public const OPERATOR_ISNOTNULL = 'isNotNull'; protected static $availableOperators = [ self::OPERATOR_EQ, @@ -71,9 +71,9 @@ abstract class Column /** * Align. */ - const ALIGN_LEFT = 'left'; - const ALIGN_RIGHT = 'right'; - const ALIGN_CENTER = 'center'; + public const ALIGN_LEFT = 'left'; + public const ALIGN_RIGHT = 'right'; + public const ALIGN_CENTER = 'center'; protected static $aligns = [ self::ALIGN_LEFT, diff --git a/Grid/Column/MassActionColumn.php b/Grid/Column/MassActionColumn.php index bd97b12b..b8cabc0b 100644 --- a/Grid/Column/MassActionColumn.php +++ b/Grid/Column/MassActionColumn.php @@ -14,7 +14,7 @@ class MassActionColumn extends Column { - const ID = '__action'; + public const ID = '__action'; public function __construct() { diff --git a/Grid/Columns.php b/Grid/Columns.php index 8cb00432..28e0acfd 100644 --- a/Grid/Columns.php +++ b/Grid/Columns.php @@ -22,7 +22,7 @@ class Columns implements \IteratorAggregate, \Countable protected $columns = []; protected $extensions = []; - private const MISSING_COLUMN_EX_MSG = 'Column with id "%s" doesn\'t exists'; + public const MISSING_COLUMN_EX_MSG = 'Column with id "%s" doesn\'t exists'; /** * @var AuthorizationCheckerInterface diff --git a/Grid/GridManager.php b/Grid/GridManager.php index eb3a2cf3..59129338 100644 --- a/Grid/GridManager.php +++ b/Grid/GridManager.php @@ -36,9 +36,9 @@ class GridManager implements IteratorAggregate, Countable protected $massActionGrid = null; - const NO_GRID_EX_MSG = 'No grid has been added to the manager.'; + public const NO_GRID_EX_MSG = 'No grid has been added to the manager.'; - const SAME_GRID_HASH_EX_MSG = 'Some grids seem similar. Please set an Indentifier for your grids.'; + public const SAME_GRID_HASH_EX_MSG = 'Some grids seem similar. Please set an Indentifier for your grids.'; public function __construct($container, Environment $twig) {