Completed
Branch BUG-10738-inconsistency-in-ses... (cda363)
by
unknown
13:38 queued 12s
created

EmailAddressFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
namespace EventEspresso\core\domain\services\factories;
4
5
use EventEspresso\core\domain\services\validation\email\EmailValidationException;
6
use EventEspresso\core\domain\values\EmailAddress;
7
use EventEspresso\core\exceptions\InvalidDataTypeException;
8
use EventEspresso\core\exceptions\InvalidInterfaceException;
9
use EventEspresso\core\services\loaders\LoaderFactory;
10
use InvalidArgumentException;
11
12
defined('EVENT_ESPRESSO_VERSION') || exit;
13
14
15
/**
16
 * Class EmailAddressFactory
17
 * creates an EmailAddress value object
18
 *
19
 * @package EventEspresso\core\domain\services\factories
20
 * @author  Brent Christensen
21
 * @since   $VID:$
22
 */
23
class EmailAddressFactory implements FactoryInterface
24
{
25
26
    /**
27
     * @param string $email_address
28
     * @return EmailAddress
29
     * @throws EmailValidationException
30
     * @throws InvalidDataTypeException
31
     * @throws InvalidInterfaceException
32
     * @throws InvalidArgumentException
33
     */
34
    public static function create($email_address)
35
    {
36
        return LoaderFactory::getLoader()->getNew(
37
            'EventEspresso\core\domain\values\EmailAddress',
38
            array($email_address)
39
        );
40
    }
41
42
}
43
// Location: core/domain/services/factories/EmailAddressFactory.php
44