Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of PharIo\Manifest.
4
 *
5
 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PharIo\Manifest;
11
 
12
class Author {
13
    /** @var string */
14
    private $name;
15
 
16
    /** @var Email */
17
    private $email;
18
 
19
    public function __construct(string $name, Email $email) {
20
        $this->name  = $name;
21
        $this->email = $email;
22
    }
23
 
24
    public function asString(): string {
25
        return \sprintf(
26
            '%s <%s>',
27
            $this->name,
28
            $this->email->asString()
29
        );
30
    }
31
 
32
    public function getName(): string {
33
        return $this->name;
34
    }
35
 
36
    public function getEmail(): Email {
37
        return $this->email;
38
    }
39
}