File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7777defined ('EXIT_DATABASE ' ) || define ('EXIT_DATABASE ' , 8 ); // database error
7878defined ('EXIT__AUTO_MIN ' ) || define ('EXIT__AUTO_MIN ' , 9 ); // lowest automatically-assigned error code
7979defined ('EXIT__AUTO_MAX ' ) || define ('EXIT__AUTO_MAX ' , 125 ); // highest automatically-assigned error code
80+
81+ /**
82+ * @deprecated Use \CodeIgniter\Events\Events::PRIORITY_LOW instead.
83+ */
84+ define ('EVENT_PRIORITY_LOW ' , 200 );
85+
86+ /**
87+ * @deprecated Use \CodeIgniter\Events\Events::PRIORITY_NORMAL instead.
88+ */
89+ define ('EVENT_PRIORITY_NORMAL ' , 100 );
90+
91+ /**
92+ * @deprecated Use \CodeIgniter\Events\Events::PRIORITY_HIGH instead.
93+ */
94+ define ('EVENT_PRIORITY_HIGH ' , 10 );
Original file line number Diff line number Diff line change 1414use Config \Modules ;
1515use Config \Services ;
1616
17- define ('EVENT_PRIORITY_LOW ' , 200 );
18- define ('EVENT_PRIORITY_NORMAL ' , 100 );
19- define ('EVENT_PRIORITY_HIGH ' , 10 );
20-
2117/**
2218 * Events
2319 */
2420class Events
2521{
22+ public const PRIORITY_LOW = 200 ;
23+ public const PRIORITY_NORMAL = 100 ;
24+ public const PRIORITY_HIGH = 10 ;
25+
2626 /**
2727 * The list of listeners.
2828 *
Original file line number Diff line number Diff line change @@ -157,15 +157,15 @@ public function testPriorityWithMultiple()
157157
158158 Events::on ('foo ' , static function () use (&$ result ) {
159159 $ result [] = 'a ' ;
160- }, EVENT_PRIORITY_NORMAL );
160+ }, Events:: PRIORITY_NORMAL );
161161
162162 Events::on ('foo ' , static function () use (&$ result ) {
163163 $ result [] = 'b ' ;
164- }, EVENT_PRIORITY_LOW );
164+ }, Events:: PRIORITY_LOW );
165165
166166 Events::on ('foo ' , static function () use (&$ result ) {
167167 $ result [] = 'c ' ;
168- }, EVENT_PRIORITY_HIGH );
168+ }, Events:: PRIORITY_HIGH );
169169
170170 Events::on ('foo ' , static function () use (&$ result ) {
171171 $ result [] = 'd ' ;
You can’t perform that action at this time.
0 commit comments