-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from alex-patterson-webdev/feature/1.0.1
Fix line separator issues (to LF) and add licence information to composer.json
- Loading branch information
Showing
12 changed files
with
415 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arp\EventDispatcher\Event; | ||
|
||
/** | ||
* @author Alex Patterson <[email protected]> | ||
* @package Arp\EventDispatcher\Event | ||
*/ | ||
abstract class AbstractEvent | ||
{ | ||
/** | ||
* @var ParametersInterface | ||
*/ | ||
protected $params; | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function __construct(array $params = []) | ||
{ | ||
$this->setParameters(new Parameters($params)); | ||
} | ||
|
||
/** | ||
* Set the parameters collection. | ||
* | ||
* @param ParametersInterface $params | ||
*/ | ||
public function setParameters(ParametersInterface $params): void | ||
{ | ||
$this->params = $params; | ||
} | ||
|
||
/** | ||
* Return the parameters collection. | ||
* | ||
* @return ParametersInterface | ||
*/ | ||
public function getParameters(): ParametersInterface | ||
{ | ||
return $this->params; | ||
} | ||
} | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arp\EventDispatcher\Event; | ||
|
||
/** | ||
* @author Alex Patterson <[email protected]> | ||
* @package Arp\EventDispatcher\Event | ||
*/ | ||
abstract class AbstractEvent | ||
{ | ||
/** | ||
* @var ParametersInterface | ||
*/ | ||
protected $params; | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function __construct(array $params = []) | ||
{ | ||
$this->setParameters(new Parameters($params)); | ||
} | ||
|
||
/** | ||
* Set the parameters collection. | ||
* | ||
* @param ParametersInterface $params | ||
*/ | ||
public function setParameters(ParametersInterface $params): void | ||
{ | ||
$this->params = $params; | ||
} | ||
|
||
/** | ||
* Return the parameters collection. | ||
* | ||
* @return ParametersInterface | ||
*/ | ||
public function getParameters(): ParametersInterface | ||
{ | ||
return $this->params; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arp\EventDispatcher\Event; | ||
|
||
use Arp\EventDispatcher\Resolver\EventNameAwareInterface; | ||
|
||
/** | ||
* @author Alex Patterson <[email protected]> | ||
* @package Arp\EventDispatcher\Event | ||
*/ | ||
class NamedEvent extends AbstractEvent implements EventNameAwareInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $eventName; | ||
|
||
/** | ||
* @param string $eventName | ||
* @param array $params | ||
*/ | ||
public function __construct(string $eventName, array $params = []) | ||
{ | ||
parent::__construct($params); | ||
|
||
$this->eventName = $eventName; | ||
} | ||
|
||
/** | ||
* Return the event name. | ||
* | ||
* @return string | ||
*/ | ||
public function getEventName(): string | ||
{ | ||
return $this->eventName; | ||
} | ||
} | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arp\EventDispatcher\Event; | ||
|
||
use Arp\EventDispatcher\Resolver\EventNameAwareInterface; | ||
|
||
/** | ||
* @author Alex Patterson <[email protected]> | ||
* @package Arp\EventDispatcher\Event | ||
*/ | ||
class NamedEvent extends AbstractEvent implements EventNameAwareInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $eventName; | ||
|
||
/** | ||
* @param string $eventName | ||
* @param array $params | ||
*/ | ||
public function __construct(string $eventName, array $params = []) | ||
{ | ||
parent::__construct($params); | ||
|
||
$this->eventName = $eventName; | ||
} | ||
|
||
/** | ||
* Return the event name. | ||
* | ||
* @return string | ||
*/ | ||
public function getEventName(): string | ||
{ | ||
return $this->eventName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,75 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arp\EventDispatcher\Event; | ||
|
||
/** | ||
* @author Alex Patterson <[email protected]> | ||
* @package Arp\EventDispatcher\Event | ||
*/ | ||
interface ParametersInterface extends \IteratorAggregate, \Countable, \ArrayAccess | ||
{ | ||
/** | ||
* @param string $name | ||
* | ||
* @return bool | ||
*/ | ||
public function hasParam(string $name): bool; | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $default | ||
* | ||
* @return mixed | ||
*/ | ||
public function getParam(string $name, $default = null); | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getParams(): array; | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function setParams(array $params): void; | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $value | ||
*/ | ||
public function setParam(string $name, $value): void; | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function removeParams(array $params = []): void; | ||
|
||
/** | ||
* @param string $name | ||
* | ||
* @return bool | ||
*/ | ||
public function removeParam(string $name): bool; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function count(): int; | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isEmpty(): bool; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getKeys(): array; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getValues(): array; | ||
} | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arp\EventDispatcher\Event; | ||
|
||
/** | ||
* @author Alex Patterson <[email protected]> | ||
* @package Arp\EventDispatcher\Event | ||
*/ | ||
interface ParametersInterface extends \IteratorAggregate, \Countable, \ArrayAccess | ||
{ | ||
/** | ||
* @param string $name | ||
* | ||
* @return bool | ||
*/ | ||
public function hasParam(string $name): bool; | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $default | ||
* | ||
* @return mixed | ||
*/ | ||
public function getParam(string $name, $default = null); | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getParams(): array; | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function setParams(array $params): void; | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $value | ||
*/ | ||
public function setParam(string $name, $value): void; | ||
|
||
/** | ||
* @param array $params | ||
*/ | ||
public function removeParams(array $params = []): void; | ||
|
||
/** | ||
* @param string $name | ||
* | ||
* @return bool | ||
*/ | ||
public function removeParam(string $name): bool; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function count(): int; | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isEmpty(): bool; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getKeys(): array; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getValues(): array; | ||
} |
Oops, something went wrong.