22 lines
422 B
PHP
22 lines
422 B
PHP
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace PHP_PHAR\utils;
|
||
|
|
||
|
use PHP_PHAR\model\Person;
|
||
|
|
||
|
/**
|
||
|
* Retrieve the hello world message per person
|
||
|
*/
|
||
|
function getHelloTo(Person $person): string
|
||
|
{
|
||
|
return "Hello to our World " . $person->getFormattedName() . " !";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Say hello world to a person list
|
||
|
*/
|
||
|
function sayHelloToAll(array $persons): void
|
||
|
{
|
||
|
foreach ($persons as $person) echo(getHelloTo($person) . "\n");
|
||
|
}
|