Skip to content

Commit ece6960

Browse files
authored
Merge pull request #16816 from tashik/fix-managerinterface
Add priority parameter to attach method in ManagerInterface
2 parents 0697aed + a4adcdc commit ece6960

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

phalcon/Events/Manager.zep

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ use SplPriorityQueue;
2121
*/
2222
class Manager implements ManagerInterface
2323
{
24-
const DEFAULT_PRIORITY = 100;
25-
2624
/**
2725
* @var bool
2826
*/

phalcon/Events/ManagerInterface.zep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ namespace Phalcon\Events;
1515
*/
1616
interface ManagerInterface
1717
{
18+
const DEFAULT_PRIORITY = 100;
1819
/**
1920
* Attach a listener to the events manager
2021
*
2122
* @param object|callable handler
2223
*/
23-
public function attach(string! eventType, handler) -> void;
24+
public function attach(string! eventType, handler, int! priority = self::DEFAULT_PRIORITY) -> void;
2425

2526
/**
2627
* Detach the listener from the events manager

tests/integration/Mvc/Dispatcher/Helper/DispatcherTestDefaultNoNamespaceController.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
<?php
1+
<?php // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
22

3-
// @codingStandardsIgnoreStart
43
use Phalcon\Mvc\Controller;
54

6-
// @codingStandardsIgnoreSEnd
7-
85
/**
96
* \DispatcherTestDefaultNoNamespaceController
107
* Dispatcher Controller for testing different dispatch scenarios
@@ -23,8 +20,8 @@
2320
*/
2421
class DispatcherTestDefaultNoNamespaceController extends Controller
2522
{
26-
const RETURN_VALUE_STRING = 'string';
27-
const RETURN_VALUE_INT = 5;
23+
public const RETURN_VALUE_STRING = 'string';
24+
public const RETURN_VALUE_INT = 5;
2825

2926
public function beforeExecuteRoute()
3027
{

0 commit comments

Comments
 (0)