mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-01 12:40:11 +02:00
remove Interface-Suffix
This commit is contained in:
30
Behavioral/Visitor/RecordingVisitor.php
Normal file
30
Behavioral/Visitor/RecordingVisitor.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Behavioral\Visitor;
|
||||
|
||||
class RecordingVisitor implements RoleVisitor
|
||||
{
|
||||
/**
|
||||
* @var Role[]
|
||||
*/
|
||||
private $visited = [];
|
||||
|
||||
public function visitGroup(Group $role)
|
||||
{
|
||||
$this->visited[] = $role;
|
||||
}
|
||||
|
||||
public function visitUser(User $role)
|
||||
{
|
||||
$this->visited[] = $role;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Role[]
|
||||
*/
|
||||
public function getVisited(): array
|
||||
{
|
||||
return $this->visited;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user