Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/EventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

namespace Behavioral\Observer;

/**
* Interface EventInterface
* @package Behavioral\Observer
*/
interface EventInterface
{
/**
Expand Down
4 changes: 0 additions & 4 deletions src/FootballEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

namespace Behavioral\Observer;

/**
* Class FootballEvent
* @package Behavioral\Observer
*/
class FootballEvent implements EventInterface
{
const GOAL = 'Goal!!!';
Expand Down
4 changes: 0 additions & 4 deletions src/FootballObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

namespace Behavioral\Observer;

/**
* Class FootballObserver
* @package Behavioral\Observer
*/
class FootballObserver implements ObserverInterface
{
/**
Expand Down
11 changes: 6 additions & 5 deletions src/FootballSubject.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

namespace Behavioral\Observer;

/**
* Class FootballSubject
* @package Behavioral\Observer
*/
class FootballSubject implements SubjectInterface
{
/**
Expand All @@ -35,9 +31,14 @@ public function __construct(string $name)

/**
* @param ObserverInterface $observer
* @throws \Exception
*/
public function attachObserver(ObserverInterface $observer): void
{
if (array_key_exists($observer->getName(), $this->observers)) {
throw new \InvalidArgumentException('Observer is already exist');
}

$this->observers[$observer->getName()] = $observer;
}

Expand All @@ -47,7 +48,7 @@ public function attachObserver(ObserverInterface $observer): void
public function detachObserver(string $name): void
{
if (!array_key_exists($name, $this->observers)) {
throw new \InvalidArgumentException();
throw new \InvalidArgumentException('Observer is not exist');
}

unset($this->observers[$name]);
Expand Down
4 changes: 0 additions & 4 deletions src/ObserverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

namespace Behavioral\Observer;

/**
* Interface ObserverInterface
* @package Behavioral\Observer
*/
interface ObserverInterface
{
/**
Expand Down
4 changes: 0 additions & 4 deletions src/SubjectInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

namespace Behavioral\Observer;

/**
* Interface SubjectInterface
* @package Behavioral\Observer
*/
interface SubjectInterface
{
/**
Expand Down
4 changes: 0 additions & 4 deletions tests/ObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
use Behavioral\Observer\SubjectInterface;
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;

/**
* Class ObserverTest
* @package Behavioral\Observer\Tests
*/
class ObserverTest extends PHPUnit_Framework_TestCase
{
/**
Expand Down