mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
start a restructure
This commit is contained in:
27
Behavioral/Visitor/RolePrintVisitor.php
Normal file
27
Behavioral/Visitor/RolePrintVisitor.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Visitor;
|
||||
|
||||
/**
|
||||
* Visitor Pattern
|
||||
*
|
||||
* An implementation of a concrete Visitor
|
||||
*/
|
||||
class RolePrintVisitor implements RoleVisitorInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function visitGroup(Group $role)
|
||||
{
|
||||
echo "Role: " . $role->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function visitUser(User $role)
|
||||
{
|
||||
echo "Role: " . $role->getName();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user