Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
1924a528
Commit
1924a528
authored
Jan 04, 2014
by
Paul Kofmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redundant event's instanceof check
And some docs punctuation.
parent
17128f10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
Event.php
framework/yii/base/Event.php
+11
-11
No files found.
framework/yii/base/Event.php
View file @
1924a528
...
@@ -67,9 +67,9 @@ class Event extends Object
...
@@ -67,9 +67,9 @@ class Event extends Object
*
*
* For more details about how to declare an event handler, please refer to [[Component::on()]].
* For more details about how to declare an event handler, please refer to [[Component::on()]].
*
*
* @param string $class the fully qualified class name to which the event handler needs to attach
* @param string $class the fully qualified class name to which the event handler needs to attach
.
* @param string $name the event name
* @param string $name the event name
.
* @param callback $handler the event handler
* @param callback $handler the event handler
.
* @param mixed $data the data to be passed to the event handler when the event is triggered.
* @param mixed $data the data to be passed to the event handler when the event is triggered.
* When the event handler is invoked, this data can be accessed via [[Event::data]].
* When the event handler is invoked, this data can be accessed via [[Event::data]].
* @see off()
* @see off()
...
@@ -84,11 +84,11 @@ class Event extends Object
...
@@ -84,11 +84,11 @@ class Event extends Object
*
*
* This method is the opposite of [[on()]].
* This method is the opposite of [[on()]].
*
*
* @param string $class the fully qualified class name from which the event handler needs to be detached
* @param string $class the fully qualified class name from which the event handler needs to be detached
.
* @param string $name the event name
* @param string $name the event name
.
* @param callback $handler the event handler to be removed.
* @param callback $handler the event handler to be removed.
* If it is null, all handlers attached to the named event will be removed.
* If it is null, all handlers attached to the named event will be removed.
* @return boolean if a handler is found and detached
* @return boolean if a handler is found and detached
.
* @see on()
* @see on()
*/
*/
public
static
function
off
(
$class
,
$name
,
$handler
=
null
)
public
static
function
off
(
$class
,
$name
,
$handler
=
null
)
...
@@ -119,8 +119,8 @@ class Event extends Object
...
@@ -119,8 +119,8 @@ class Event extends Object
* Returns a value indicating whether there is any handler attached to the specified class-level event.
* Returns a value indicating whether there is any handler attached to the specified class-level event.
* Note that this method will also check all parent classes to see if there is any handler attached
* Note that this method will also check all parent classes to see if there is any handler attached
* to the named event.
* to the named event.
* @param string|object $class the object or the fully qualified class name specifying the class-level event
* @param string|object $class the object or the fully qualified class name specifying the class-level event
.
* @param string $name the event name
* @param string $name the event name
.
* @return boolean whether there is any handler attached to the event.
* @return boolean whether there is any handler attached to the event.
*/
*/
public
static
function
hasHandlers
(
$class
,
$name
)
public
static
function
hasHandlers
(
$class
,
$name
)
...
@@ -145,8 +145,8 @@ class Event extends Object
...
@@ -145,8 +145,8 @@ class Event extends Object
* Triggers a class-level event.
* Triggers a class-level event.
* This method will cause invocation of event handlers that are attached to the named event
* This method will cause invocation of event handlers that are attached to the named event
* for the specified class and all its parent classes.
* for the specified class and all its parent classes.
* @param string|object $class the object or the fully qualified class name specifying the class-level event
* @param string|object $class the object or the fully qualified class name specifying the class-level event
.
* @param string $name the event name
* @param string $name the event name
.
* @param Event $event the event parameter. If not set, a default [[Event]] object will be created.
* @param Event $event the event parameter. If not set, a default [[Event]] object will be created.
*/
*/
public
static
function
trigger
(
$class
,
$name
,
$event
=
null
)
public
static
function
trigger
(
$class
,
$name
,
$event
=
null
)
...
@@ -173,7 +173,7 @@ class Event extends Object
...
@@ -173,7 +173,7 @@ class Event extends Object
foreach
(
self
::
$_events
[
$name
][
$class
]
as
$handler
)
{
foreach
(
self
::
$_events
[
$name
][
$class
]
as
$handler
)
{
$event
->
data
=
$handler
[
1
];
$event
->
data
=
$handler
[
1
];
call_user_func
(
$handler
[
0
],
$event
);
call_user_func
(
$handler
[
0
],
$event
);
if
(
$event
instanceof
Event
&&
$event
->
handled
)
{
if
(
$event
->
handled
)
{
return
;
return
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment