Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 32 changed files with 436 additions and 696 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

21 changes: 11 additions & 10 deletions composer.json
@@ -1,28 +1,29 @@
{
"name": "zendframework/zend-event-manager",
"description": "Zend\\EventManager component",
"name": "zendframework/zend-eventmanager",
"description": " ",
"license": "BSD-3-Clause",
"keywords": [
"zf2",
"event-manager"
"eventmanager"
],
"autoload": {
"psr-4": {
"Zend\\EventManager\\": "src/"
"Zend\\EventManager": "src/"
}
},
"require": {
"php": ">=5.3.23"
},
"require-dev": {
"fabpot/php-cs-fixer": "1.7.*",
"satooshi/php-coveralls": "dev-master",
"phpunit/PHPUnit": "~4.0"
"php": ">=5.3.3",
"zendframework/zend-stdlib": "self.version"
},
"homepage": "https://github.com/zendframework/zend-event-manager",
"autoload-dev": {
"psr-4": {
"ZendTest\\EventManager\\": "test/"
}
},
"require-dev": {
"fabpot/php-cs-fixer": "1.7.*",
"satooshi/php-coveralls": "dev-master",
"phpunit/PHPUnit": "~4.0"
}
}
66 changes: 27 additions & 39 deletions src/Event.php
@@ -1,21 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_EventManager
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_EventManager
*/

namespace Zend\EventManager;
Expand All @@ -25,13 +15,11 @@
/**
* Representation of an event
*
* Encapsulates the target context and parameters passed, and provides some
* Encapsulates the target context and parameters passed, and provides some
* behavior for interacting with the event manager.
*
* @category Zend
* @package Zend_EventManager
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Event implements EventInterface
{
Expand Down Expand Up @@ -59,10 +47,10 @@ class Event implements EventInterface
* Constructor
*
* Accept a target and its parameters.
*
*
* @param string $name Event name
* @param string|object $target
* @param array|ArrayAccess $params
* @param string|object $target
* @param array|ArrayAccess $params
* @return void
*/
public function __construct($name = null, $target = null, $params = null)
Expand All @@ -82,7 +70,7 @@ public function __construct($name = null, $target = null, $params = null)

/**
* Get event name
*
*
* @return string
*/
public function getName()
Expand All @@ -94,7 +82,7 @@ public function getName()
* Get the event target
*
* This may be either an object, or the name of a static method.
*
*
* @return string|object
*/
public function getTarget()
Expand All @@ -106,8 +94,8 @@ public function getTarget()
* Set parameters
*
* Overwrites parameters
*
* @param array|ArrayAccess|object $params
*
* @param array|ArrayAccess|object $params
* @return Event
* @throws Exception\InvalidArgumentException
*/
Expand All @@ -125,7 +113,7 @@ public function setParams($params)

/**
* Get all parameters
*
*
* @return array|object|ArrayAccess
*/
public function getParams()
Expand All @@ -137,9 +125,9 @@ public function getParams()
* Get an individual parameter
*
* If the parameter does not exist, the $default value will be returned.
*
* @param string|int $name
* @param mixed $default
*
* @param string|int $name
* @param mixed $default
* @return mixed
*/
public function getParam($name, $default = null)
Expand All @@ -162,8 +150,8 @@ public function getParam($name, $default = null)

/**
* Set the event name
*
* @param string $name
*
* @param string $name
* @return Event
*/
public function setName($name)
Expand All @@ -174,8 +162,8 @@ public function setName($name)

/**
* Set the event target/context
*
* @param null|string|object $target
*
* @param null|string|object $target
* @return Event
*/
public function setTarget($target)
Expand All @@ -186,9 +174,9 @@ public function setTarget($target)

/**
* Set an individual parameter to a value
*
* @param string|int $name
* @param mixed $value
*
* @param string|int $name
* @param mixed $value
* @return Event
*/
public function setParam($name, $value)
Expand All @@ -205,8 +193,8 @@ public function setParam($name, $value)

/**
* Stop further event propagation
*
* @param bool $flag
*
* @param bool $flag
* @return void
*/
public function stopPropagation($flag = true)
Expand All @@ -216,7 +204,7 @@ public function stopPropagation($flag = true)

/**
* Is propagation stopped?
*
*
* @return bool
*/
public function propagationIsStopped()
Expand Down
56 changes: 22 additions & 34 deletions src/EventInterface.php
@@ -1,21 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_EventManager
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_EventManager
*/

namespace Zend\EventManager;
Expand All @@ -27,85 +17,83 @@
*
* @category Zend
* @package Zend_EventManager
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface EventInterface
{
/**
* Get event name
*
*
* @return string
*/
public function getName();

/**
* Get target/context from which event was triggered
*
*
* @return null|string|object
*/
public function getTarget();

/**
* Get parameters passed to the event
*
*
* @return array|ArrayAccess
*/
public function getParams();

/**
* Get a single parameter by name
*
* @param string $name
*
* @param string $name
* @param mixed $default Default value to return if parameter does not exist
* @return mixed
*/
public function getParam($name, $default = null);

/**
* Set the event name
*
* @param string $name
*
* @param string $name
* @return void
*/
public function setName($name);

/**
* Set the event target/context
*
* @param null|string|object $target
*
* @param null|string|object $target
* @return void
*/
public function setTarget($target);

/**
* Set event parameters
*
* @param string $params
*
* @param string $params
* @return void
*/
public function setParams($params);

/**
* Set a single parameter by key
*
* @param string $name
* @param mixed $value
*
* @param string $name
* @param mixed $value
* @return void
*/
public function setParam($name, $value);

/**
* Indicate whether or not the parent EventManagerInterface should stop propagating events
*
* @param bool $flag
*
* @param bool $flag
* @return void
*/
public function stopPropagation($flag = true);

/**
* Has this event indicated event propagation should stop?
*
*
* @return bool
*/
public function propagationIsStopped();
Expand Down

0 comments on commit eebf7bc

Please sign in to comment.