From f8cb0c50a48cb7781a3d9187d9a16302c664f851 Mon Sep 17 00:00:00 2001 From: Ilya Bakhlin Date: Sat, 25 Dec 2021 22:41:03 +0100 Subject: [PATCH] Reformatting the Event class. --- chandler/Eventing/Events/Event.php | 87 +++++++++++++++++++++--------- phpunit.xml | 2 +- 2 files changed, 63 insertions(+), 26 deletions(-) diff --git a/chandler/Eventing/Events/Event.php b/chandler/Eventing/Events/Event.php index 6aee909..35bd438 100644 --- a/chandler/Eventing/Events/Event.php +++ b/chandler/Eventing/Events/Event.php @@ -1,37 +1,74 @@ -code; + } + + /** + * @return string + */ + public function getData(): string + { + return $this->data; + } + + /** + * @return int + */ + public function getTime(): int + { + return $this->time; + } + + /** + * @return bool + */ + public function isTainted(): bool + { + return !$this->pristine; + } + + /** + * @param string $data + * @param float $code + */ + public function __construct(string $data = "", float $code = 0.0) { $this->data = $data; $this->code = $code; $this->time = time(); } - - function getData() - { - return $this->data; - } - - function getCode() - { - return $this->code; - } - - function getTime() - { - return $this->time; - } - - function isTainted() - { - return !$this->pristine; - } } diff --git a/phpunit.xml b/phpunit.xml index fe77420..4410f54 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + chandler/Eventing/Events/Event.php