Completed
Branch BUG-11108-ticket-reserved-coun... (144d27)
by
unknown
14:21 queued 17s
created
core/services/loaders/CoreLoader.php 2 patches
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -32,115 +32,115 @@
 block discarded – undo
32 32
 class CoreLoader implements LoaderDecoratorInterface
33 33
 {
34 34
 
35
-    /**
36
-     * @var EE_Registry|CoffeeShop $generator
37
-     */
38
-    private $generator;
39
-
40
-
41
-
42
-    /**
43
-     * CoreLoader constructor.
44
-     *
45
-     * @param EE_Registry|CoffeeShop $generator
46
-     * @throws InvalidArgumentException
47
-     */
48
-    public function __construct($generator)
49
-    {
50
-        if(!($generator instanceof EE_Registry || $generator instanceof CoffeeShop)) {
51
-            throw new InvalidArgumentException(
52
-                esc_html__(
53
-                    'The CoreLoader class must receive an instance of EE_Registry or the CoffeeShop DI container.',
54
-                    'event_espresso'
55
-                )
56
-            );
57
-        }
58
-        $this->generator = $generator;
59
-    }
60
-
61
-
62
-
63
-    /**
64
-     * Calls the appropriate loading method from the installed generator;
65
-     * If EE_Registry is being used, then the additional parameters for the EE_Registry::create() method
66
-     * can be added to the $arguments array and they will be extracted and passed to EE_Registry::create(),
67
-     * but NOT to the class being instantiated.
68
-     * This is done by adding the parameters to the $arguments array as follows:
69
-     *  array(
70
-     *      'EE_Registry::create(from_db)'   => true, // boolean value, default = false
71
-     *      'EE_Registry::create(load_only)' => true, // boolean value, default = false
72
-     *      'EE_Registry::create(addon)'     => true, // boolean value, default = false
73
-     *  )
74
-     *
75
-     * @param string $fqcn
76
-     * @param array  $arguments
77
-     * @param bool   $shared
78
-     * @return mixed
79
-     * @throws OutOfBoundsException
80
-     * @throws ServiceExistsException
81
-     * @throws InstantiationException
82
-     * @throws InvalidIdentifierException
83
-     * @throws InvalidDataTypeException
84
-     * @throws InvalidClassException
85
-     * @throws EE_Error
86
-     * @throws ServiceNotFoundException
87
-     * @throws ReflectionException
88
-     */
89
-    public function load($fqcn, $arguments = array(), $shared = true)
90
-    {
91
-        $shared = filter_var($shared, FILTER_VALIDATE_BOOLEAN);
92
-        if($this->generator instanceof EE_Registry) {
93
-            // check if additional EE_Registry::create() arguments have been passed
94
-            // from_db
95
-            $from_db = isset($arguments['EE_Registry::create(from_db)'])
96
-                ? filter_var($arguments['EE_Registry::create(from_db)'], FILTER_VALIDATE_BOOLEAN)
97
-                : false;
98
-            // load_only
99
-            $load_only = isset($arguments['EE_Registry::create(load_only)'])
100
-                ? filter_var($arguments['EE_Registry::create(load_only)'], FILTER_VALIDATE_BOOLEAN)
101
-                : false;
102
-            // addon
103
-            $addon = isset($arguments['EE_Registry::create(addon)'])
104
-                ? filter_var($arguments['EE_Registry::create(addon)'], FILTER_VALIDATE_BOOLEAN)
105
-                : false;
106
-            unset(
107
-                $arguments['EE_Registry::create(from_db)'],
108
-                $arguments['EE_Registry::create(load_only)'],
109
-                $arguments['EE_Registry::create(addon)']
110
-            );
111
-            // addons need to be cached on EE_Registry
112
-            $shared = $addon ? true : $shared;
113
-            return $this->generator->create(
114
-                $fqcn,
115
-                $arguments,
116
-                $shared,
117
-                $from_db,
118
-                $load_only,
119
-                $addon
120
-            );
121
-        }
122
-        return $this->generator->brew(
123
-            $fqcn,
124
-            $arguments,
125
-            $shared ? CoffeeMaker::BREW_SHARED : CoffeeMaker::BREW_NEW
126
-        );
127
-
128
-    }
129
-
130
-
131
-
132
-    /**
133
-     * calls reset() on generator if method exists
134
-     *
135
-     * @throws EE_Error
136
-     * @throws ReflectionException
137
-     */
138
-    public function reset()
139
-    {
140
-        if (method_exists($this->generator, 'reset')) {
141
-            $this->generator->reset();
142
-        }
143
-    }
35
+	/**
36
+	 * @var EE_Registry|CoffeeShop $generator
37
+	 */
38
+	private $generator;
39
+
40
+
41
+
42
+	/**
43
+	 * CoreLoader constructor.
44
+	 *
45
+	 * @param EE_Registry|CoffeeShop $generator
46
+	 * @throws InvalidArgumentException
47
+	 */
48
+	public function __construct($generator)
49
+	{
50
+		if(!($generator instanceof EE_Registry || $generator instanceof CoffeeShop)) {
51
+			throw new InvalidArgumentException(
52
+				esc_html__(
53
+					'The CoreLoader class must receive an instance of EE_Registry or the CoffeeShop DI container.',
54
+					'event_espresso'
55
+				)
56
+			);
57
+		}
58
+		$this->generator = $generator;
59
+	}
60
+
61
+
62
+
63
+	/**
64
+	 * Calls the appropriate loading method from the installed generator;
65
+	 * If EE_Registry is being used, then the additional parameters for the EE_Registry::create() method
66
+	 * can be added to the $arguments array and they will be extracted and passed to EE_Registry::create(),
67
+	 * but NOT to the class being instantiated.
68
+	 * This is done by adding the parameters to the $arguments array as follows:
69
+	 *  array(
70
+	 *      'EE_Registry::create(from_db)'   => true, // boolean value, default = false
71
+	 *      'EE_Registry::create(load_only)' => true, // boolean value, default = false
72
+	 *      'EE_Registry::create(addon)'     => true, // boolean value, default = false
73
+	 *  )
74
+	 *
75
+	 * @param string $fqcn
76
+	 * @param array  $arguments
77
+	 * @param bool   $shared
78
+	 * @return mixed
79
+	 * @throws OutOfBoundsException
80
+	 * @throws ServiceExistsException
81
+	 * @throws InstantiationException
82
+	 * @throws InvalidIdentifierException
83
+	 * @throws InvalidDataTypeException
84
+	 * @throws InvalidClassException
85
+	 * @throws EE_Error
86
+	 * @throws ServiceNotFoundException
87
+	 * @throws ReflectionException
88
+	 */
89
+	public function load($fqcn, $arguments = array(), $shared = true)
90
+	{
91
+		$shared = filter_var($shared, FILTER_VALIDATE_BOOLEAN);
92
+		if($this->generator instanceof EE_Registry) {
93
+			// check if additional EE_Registry::create() arguments have been passed
94
+			// from_db
95
+			$from_db = isset($arguments['EE_Registry::create(from_db)'])
96
+				? filter_var($arguments['EE_Registry::create(from_db)'], FILTER_VALIDATE_BOOLEAN)
97
+				: false;
98
+			// load_only
99
+			$load_only = isset($arguments['EE_Registry::create(load_only)'])
100
+				? filter_var($arguments['EE_Registry::create(load_only)'], FILTER_VALIDATE_BOOLEAN)
101
+				: false;
102
+			// addon
103
+			$addon = isset($arguments['EE_Registry::create(addon)'])
104
+				? filter_var($arguments['EE_Registry::create(addon)'], FILTER_VALIDATE_BOOLEAN)
105
+				: false;
106
+			unset(
107
+				$arguments['EE_Registry::create(from_db)'],
108
+				$arguments['EE_Registry::create(load_only)'],
109
+				$arguments['EE_Registry::create(addon)']
110
+			);
111
+			// addons need to be cached on EE_Registry
112
+			$shared = $addon ? true : $shared;
113
+			return $this->generator->create(
114
+				$fqcn,
115
+				$arguments,
116
+				$shared,
117
+				$from_db,
118
+				$load_only,
119
+				$addon
120
+			);
121
+		}
122
+		return $this->generator->brew(
123
+			$fqcn,
124
+			$arguments,
125
+			$shared ? CoffeeMaker::BREW_SHARED : CoffeeMaker::BREW_NEW
126
+		);
127
+
128
+	}
129
+
130
+
131
+
132
+	/**
133
+	 * calls reset() on generator if method exists
134
+	 *
135
+	 * @throws EE_Error
136
+	 * @throws ReflectionException
137
+	 */
138
+	public function reset()
139
+	{
140
+		if (method_exists($this->generator, 'reset')) {
141
+			$this->generator->reset();
142
+		}
143
+	}
144 144
 
145 145
 }
146 146
 // End of file CoreLoader.php
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function __construct($generator)
49 49
     {
50
-        if(!($generator instanceof EE_Registry || $generator instanceof CoffeeShop)) {
50
+        if ( ! ($generator instanceof EE_Registry || $generator instanceof CoffeeShop)) {
51 51
             throw new InvalidArgumentException(
52 52
                 esc_html__(
53 53
                     'The CoreLoader class must receive an instance of EE_Registry or the CoffeeShop DI container.',
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     public function load($fqcn, $arguments = array(), $shared = true)
90 90
     {
91 91
         $shared = filter_var($shared, FILTER_VALIDATE_BOOLEAN);
92
-        if($this->generator instanceof EE_Registry) {
92
+        if ($this->generator instanceof EE_Registry) {
93 93
             // check if additional EE_Registry::create() arguments have been passed
94 94
             // from_db
95 95
             $from_db = isset($arguments['EE_Registry::create(from_db)'])
Please login to merge, or discard this patch.
core/exceptions/InvalidFilePathException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,19 +25,19 @@
 block discarded – undo
25 25
 	 * @param int        $code
26 26
 	 * @param \Exception $previous
27 27
 	 */
28
-	public function __construct( $file_path, $message = '', $code = 0, \Exception $previous = null ) {
29
-		if ( empty( $message ) ) {
28
+	public function __construct($file_path, $message = '', $code = 0, \Exception $previous = null) {
29
+		if (empty($message)) {
30 30
 			$message = sprintf(
31 31
 				__(
32 32
 					'The "%1$s" file is either missing or could not be read due to permissions. Please ensure that the following path is correct and verify that the file permissions are correct:%2$s %3$s',
33 33
 					'event_espresso'
34 34
 				),
35
-				basename( $file_path ),
35
+				basename($file_path),
36 36
 				'<br />',
37 37
 				$file_path
38 38
 			);
39 39
 		}
40
-		parent::__construct( $message, $code, $previous );
40
+		parent::__construct($message, $code, $previous);
41 41
 	}
42 42
 
43 43
 }
Please login to merge, or discard this patch.
core/exceptions/InvalidInterfaceException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
25 25
 	 * @param int        $code
26 26
 	 * @param \Exception $previous
27 27
 	 */
28
-	public function __construct( $interface_name, $message = '', $code = 0, \Exception $previous = null ) {
29
-		if ( empty( $message ) ) {
28
+	public function __construct($interface_name, $message = '', $code = 0, \Exception $previous = null) {
29
+		if (empty($message)) {
30 30
 			$message = sprintf(
31
-				__( 'The "%1$s" Interface is either missing or invalid.', 'event_espresso' ),
31
+				__('The "%1$s" Interface is either missing or invalid.', 'event_espresso'),
32 32
 				$interface_name
33 33
 			);
34 34
 		}
35
-		parent::__construct( $message, $code, $previous );
35
+		parent::__construct($message, $code, $previous);
36 36
 	}
37 37
 
38 38
 }
Please login to merge, or discard this patch.
core/exceptions/InvalidDataTypeException.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 * @param int        $code
30 30
 	 * @param Exception $previous
31 31
 	 */
32
-	public function __construct( $var_name, $variable, $expected, $message = '', $code = 0, Exception $previous = null ) {
33
-		if ( empty( $message ) ) {
34
-			$expected = strpos( ' was expected.', $expected ) === false
35
-				? $this->addIndefiniteArticle( $expected ) . ' was expected.'
32
+	public function __construct($var_name, $variable, $expected, $message = '', $code = 0, Exception $previous = null) {
33
+		if (empty($message)) {
34
+			$expected = strpos(' was expected.', $expected) === false
35
+				? $this->addIndefiniteArticle($expected).' was expected.'
36 36
 				: $expected;
37 37
 			$message = sprintf(
38 38
 				__(
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 					'event_espresso'
41 41
 				),
42 42
 				$var_name,
43
-				$this->addIndefiniteArticle( gettype( $variable ) ),
43
+				$this->addIndefiniteArticle(gettype($variable)),
44 44
 				$expected
45 45
 			);
46 46
 		}
47
-		parent::__construct( $message, $code, $previous );
47
+		parent::__construct($message, $code, $previous);
48 48
 	}
49 49
 
50 50
 
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 	 * @param $string
54 54
 	 * @return string
55 55
 	 */
56
-	protected function addIndefiniteArticle( $string ) {
57
-		if ( strtolower( $string ) === 'null' ) {
56
+	protected function addIndefiniteArticle($string) {
57
+		if (strtolower($string) === 'null') {
58 58
 			return $string;
59 59
 		}
60
-		return ( stripos( 'aeiou', $string[0] ) !== false ? 'an ' : 'a ' ) . $string;
60
+		return (stripos('aeiou', $string[0]) !== false ? 'an ' : 'a ').$string;
61 61
 	}
62 62
 }
63 63
 // End of file InvalidDataTypeException.php
Please login to merge, or discard this patch.
core/exceptions/InvalidClassException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
 	 * @param int        $code
25 25
 	 * @param \Exception $previous
26 26
 	 */
27
-	public function __construct( $class_name, $message = '', $code = 0, \Exception $previous = null ) {
28
-		if ( empty( $message ) ) {
27
+	public function __construct($class_name, $message = '', $code = 0, \Exception $previous = null) {
28
+		if (empty($message)) {
29 29
 			$message = sprintf(
30
-				__( 'The "%1$s" Class is either missing or invalid.', 'event_espresso' ),
30
+				__('The "%1$s" Class is either missing or invalid.', 'event_espresso'),
31 31
 				$class_name
32 32
 			);
33 33
 		}
34
-		parent::__construct( $message, $code, $previous );
34
+		parent::__construct($message, $code, $previous);
35 35
 	}
36 36
 
37 37
 }
Please login to merge, or discard this patch.
core/domain/DomainFactory.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public static function getShared(FullyQualifiedName $domain_fqcn, array $arguments)
42 42
     {
43
-        if (! isset($arguments[0], $arguments[1])) {
43
+        if ( ! isset($arguments[0], $arguments[1])) {
44 44
             throw new InvalidArgumentException(
45 45
                 esc_html__(
46 46
                     'You need to pass at least two arguments, representing the addon plugin file and version, in order to generate a Domain class',
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             );
50 50
         }
51 51
         $domain = LoaderFactory::getLoader()->getShared($domain_fqcn, $arguments);
52
-        if (! $domain instanceof $domain_fqcn && ! $domain instanceof DomainBase) {
52
+        if ( ! $domain instanceof $domain_fqcn && ! $domain instanceof DomainBase) {
53 53
             throw new DomainException(
54 54
                 sprintf(
55 55
                     esc_html__(
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -24,44 +24,44 @@
 block discarded – undo
24 24
 class DomainFactory
25 25
 {
26 26
 
27
-    /**
28
-     * @param FullyQualifiedName $domain_fqcn   [required] Fully Qualified Class Name for the Domain class
29
-     * @param array $arguments                  [required] array of arguments to be passed to the Domain class
30
-     *                                          constructor. Must at least include the following two value objects:
31
-     *                                          array(
32
-     *                                              EventEspresso\core\domain\values\FilePath $plugin_file
33
-     *                                              EventEspresso\core\domain\values\Version $version
34
-     *                                          )
35
-     * @return mixed
36
-     * @throws DomainException
37
-     * @throws InvalidArgumentException
38
-     * @throws InvalidDataTypeException
39
-     * @throws InvalidInterfaceException
40
-     */
41
-    public static function getShared(FullyQualifiedName $domain_fqcn, array $arguments)
42
-    {
43
-        if (! isset($arguments[0], $arguments[1])) {
44
-            throw new InvalidArgumentException(
45
-                esc_html__(
46
-                    'You need to pass at least two arguments, representing the addon plugin file and version, in order to generate a Domain class',
47
-                    'event_espresso'
48
-                )
49
-            );
50
-        }
51
-        $domain = LoaderFactory::getLoader()->getShared($domain_fqcn, $arguments);
52
-        if (! $domain instanceof $domain_fqcn && ! $domain instanceof DomainBase) {
53
-            throw new DomainException(
54
-                sprintf(
55
-                    esc_html__(
56
-                        'The requested Domain class "%1$s" could not be loaded.',
57
-                        'event_espresso'
58
-                    ),
59
-                    $domain_fqcn
60
-                )
61
-            );
62
-        }
63
-        return $domain;
64
-    }
27
+	/**
28
+	 * @param FullyQualifiedName $domain_fqcn   [required] Fully Qualified Class Name for the Domain class
29
+	 * @param array $arguments                  [required] array of arguments to be passed to the Domain class
30
+	 *                                          constructor. Must at least include the following two value objects:
31
+	 *                                          array(
32
+	 *                                              EventEspresso\core\domain\values\FilePath $plugin_file
33
+	 *                                              EventEspresso\core\domain\values\Version $version
34
+	 *                                          )
35
+	 * @return mixed
36
+	 * @throws DomainException
37
+	 * @throws InvalidArgumentException
38
+	 * @throws InvalidDataTypeException
39
+	 * @throws InvalidInterfaceException
40
+	 */
41
+	public static function getShared(FullyQualifiedName $domain_fqcn, array $arguments)
42
+	{
43
+		if (! isset($arguments[0], $arguments[1])) {
44
+			throw new InvalidArgumentException(
45
+				esc_html__(
46
+					'You need to pass at least two arguments, representing the addon plugin file and version, in order to generate a Domain class',
47
+					'event_espresso'
48
+				)
49
+			);
50
+		}
51
+		$domain = LoaderFactory::getLoader()->getShared($domain_fqcn, $arguments);
52
+		if (! $domain instanceof $domain_fqcn && ! $domain instanceof DomainBase) {
53
+			throw new DomainException(
54
+				sprintf(
55
+					esc_html__(
56
+						'The requested Domain class "%1$s" could not be loaded.',
57
+						'event_espresso'
58
+					),
59
+					$domain_fqcn
60
+				)
61
+			);
62
+		}
63
+		return $domain;
64
+	}
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.
core/domain/values/FilePath.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -20,42 +20,42 @@
 block discarded – undo
20 20
 class FilePath
21 21
 {
22 22
 
23
-    /**
24
-     * @var string file_path
25
-     */
26
-    private $file_path;
27
-
28
-
29
-    /**
30
-     * FilePath constructor.
31
-     *
32
-     * @param string $file_path
33
-     * @throws InvalidDataTypeException
34
-     * @throws InvalidFilePathException
35
-     */
36
-    public function __construct($file_path)
37
-    {
38
-        if (! is_string($file_path)) {
39
-            throw new InvalidDataTypeException(
40
-                '$file_path',
41
-                $file_path,
42
-                'string'
43
-            );
44
-        }
45
-        if (! is_readable($file_path)) {
46
-            throw new InvalidFilePathException($file_path);
47
-        }
48
-        $this->file_path = $file_path;
49
-    }
50
-
51
-
52
-    /**
53
-     * @return string
54
-     */
55
-    public function __toString()
56
-    {
57
-        return $this->file_path;
58
-    }
23
+	/**
24
+	 * @var string file_path
25
+	 */
26
+	private $file_path;
27
+
28
+
29
+	/**
30
+	 * FilePath constructor.
31
+	 *
32
+	 * @param string $file_path
33
+	 * @throws InvalidDataTypeException
34
+	 * @throws InvalidFilePathException
35
+	 */
36
+	public function __construct($file_path)
37
+	{
38
+		if (! is_string($file_path)) {
39
+			throw new InvalidDataTypeException(
40
+				'$file_path',
41
+				$file_path,
42
+				'string'
43
+			);
44
+		}
45
+		if (! is_readable($file_path)) {
46
+			throw new InvalidFilePathException($file_path);
47
+		}
48
+		$this->file_path = $file_path;
49
+	}
50
+
51
+
52
+	/**
53
+	 * @return string
54
+	 */
55
+	public function __toString()
56
+	{
57
+		return $this->file_path;
58
+	}
59 59
 
60 60
 
61 61
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@
 block discarded – undo
35 35
      */
36 36
     public function __construct($file_path)
37 37
     {
38
-        if (! is_string($file_path)) {
38
+        if ( ! is_string($file_path)) {
39 39
             throw new InvalidDataTypeException(
40 40
                 '$file_path',
41 41
                 $file_path,
42 42
                 'string'
43 43
             );
44 44
         }
45
-        if (! is_readable($file_path)) {
45
+        if ( ! is_readable($file_path)) {
46 46
             throw new InvalidFilePathException($file_path);
47 47
         }
48 48
         $this->file_path = $file_path;
Please login to merge, or discard this patch.
core/domain/values/FullyQualifiedName.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -21,45 +21,45 @@
 block discarded – undo
21 21
 class FullyQualifiedName
22 22
 {
23 23
 
24
-    /**
25
-     * @var string $fully_qualified_name
26
-     */
27
-    private $fully_qualified_name;
24
+	/**
25
+	 * @var string $fully_qualified_name
26
+	 */
27
+	private $fully_qualified_name;
28 28
 
29 29
 
30
-    /**
31
-     * FullyQualifiedName constructor.
32
-     *
33
-     * @param string $fully_qualified_name
34
-     * @throws InvalidClassException
35
-     * @throws InvalidInterfaceException
36
-     * @throws InvalidDataTypeException
37
-     */
38
-    public function __construct($fully_qualified_name)
39
-    {
40
-        if (! is_string($fully_qualified_name)) {
41
-            throw new InvalidDataTypeException(
42
-                '$fully_qualified_name',
43
-                $fully_qualified_name,
44
-                'string'
45
-            );
46
-        }
47
-        if (! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
48
-            if (strpos($fully_qualified_name, 'Interface') !== false) {
49
-                throw new InvalidInterfaceException($fully_qualified_name);
50
-            }
51
-            throw new InvalidClassException($fully_qualified_name);
52
-        }
53
-        $this->fully_qualified_name = $fully_qualified_name;
54
-    }
30
+	/**
31
+	 * FullyQualifiedName constructor.
32
+	 *
33
+	 * @param string $fully_qualified_name
34
+	 * @throws InvalidClassException
35
+	 * @throws InvalidInterfaceException
36
+	 * @throws InvalidDataTypeException
37
+	 */
38
+	public function __construct($fully_qualified_name)
39
+	{
40
+		if (! is_string($fully_qualified_name)) {
41
+			throw new InvalidDataTypeException(
42
+				'$fully_qualified_name',
43
+				$fully_qualified_name,
44
+				'string'
45
+			);
46
+		}
47
+		if (! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
48
+			if (strpos($fully_qualified_name, 'Interface') !== false) {
49
+				throw new InvalidInterfaceException($fully_qualified_name);
50
+			}
51
+			throw new InvalidClassException($fully_qualified_name);
52
+		}
53
+		$this->fully_qualified_name = $fully_qualified_name;
54
+	}
55 55
 
56 56
 
57
-    /**
58
-     * @return string
59
-     */
60
-    public function __toString()
61
-    {
62
-        return $this->fully_qualified_name;
63
-    }
57
+	/**
58
+	 * @return string
59
+	 */
60
+	public function __toString()
61
+	{
62
+		return $this->fully_qualified_name;
63
+	}
64 64
 
65 65
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@
 block discarded – undo
37 37
      */
38 38
     public function __construct($fully_qualified_name)
39 39
     {
40
-        if (! is_string($fully_qualified_name)) {
40
+        if ( ! is_string($fully_qualified_name)) {
41 41
             throw new InvalidDataTypeException(
42 42
                 '$fully_qualified_name',
43 43
                 $fully_qualified_name,
44 44
                 'string'
45 45
             );
46 46
         }
47
-        if (! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
47
+        if ( ! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
48 48
             if (strpos($fully_qualified_name, 'Interface') !== false) {
49 49
                 throw new InvalidInterfaceException($fully_qualified_name);
50 50
             }
Please login to merge, or discard this patch.
core/domain/DomainBase.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
 
122 122
 
123 123
     /**
124
-     * @return Version
124
+     * @return string
125 125
      */
126 126
     public function versionValueObject()
127 127
     {
Please login to merge, or discard this patch.
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -21,112 +21,112 @@
 block discarded – undo
21 21
 abstract class DomainBase implements DomainInterface
22 22
 {
23 23
 
24
-    /**
25
-     * Equivalent to `__FILE__` for main plugin file.
26
-     *
27
-     * @var FilePath
28
-     */
29
-    private $plugin_file;
30
-
31
-    /**
32
-     * String indicating version for plugin
33
-     *
34
-     * @var string
35
-     */
36
-    private $version;
37
-
38
-    /**
39
-     * @var string $plugin_basename
40
-     */
41
-    private $plugin_basename;
42
-
43
-    /**
44
-     * @var string $plugin_path
45
-     */
46
-    private $plugin_path;
47
-
48
-    /**
49
-     * @var string $plugin_url
50
-     */
51
-    private $plugin_url;
52
-
53
-
54
-
55
-    /**
56
-     * Initializes internal properties.
57
-     *
58
-     * @param FilePath $plugin_file
59
-     * @param Version  $version
60
-     * @throws InvalidArgumentException
61
-     * @throws DomainException
62
-     */
63
-    public function __construct(FilePath $plugin_file, Version $version)
64
-    {
65
-        $this->plugin_file = $plugin_file;
66
-        $this->version = $version;
67
-        $this->plugin_basename = plugin_basename($this->pluginFile());
68
-        $this->plugin_path = plugin_dir_path($this->pluginFile());
69
-        $this->plugin_url = plugin_dir_url($this->pluginFile());
70
-    }
71
-
72
-
73
-    /**
74
-     * @return string
75
-     */
76
-    public function pluginFile()
77
-    {
78
-        return (string) $this->plugin_file;
79
-    }
80
-
81
-
82
-
83
-    /**
84
-     * @return string
85
-     */
86
-    public function pluginBasename()
87
-    {
88
-        return $this->plugin_basename;
89
-    }
90
-
91
-
92
-
93
-    /**
94
-     * @return string
95
-     */
96
-    public function pluginPath()
97
-    {
98
-        return $this->plugin_path;
99
-    }
100
-
101
-
102
-
103
-    /**
104
-     * @return string
105
-     */
106
-    public function pluginUrl()
107
-    {
108
-        return $this->plugin_url;
109
-    }
110
-
111
-
112
-
113
-    /**
114
-     * @return string
115
-     */
116
-    public function version()
117
-    {
118
-        return (string) $this->version;
119
-    }
120
-
121
-
122
-
123
-    /**
124
-     * @return Version
125
-     */
126
-    public function versionValueObject()
127
-    {
128
-        return $this->version;
129
-    }
24
+	/**
25
+	 * Equivalent to `__FILE__` for main plugin file.
26
+	 *
27
+	 * @var FilePath
28
+	 */
29
+	private $plugin_file;
30
+
31
+	/**
32
+	 * String indicating version for plugin
33
+	 *
34
+	 * @var string
35
+	 */
36
+	private $version;
37
+
38
+	/**
39
+	 * @var string $plugin_basename
40
+	 */
41
+	private $plugin_basename;
42
+
43
+	/**
44
+	 * @var string $plugin_path
45
+	 */
46
+	private $plugin_path;
47
+
48
+	/**
49
+	 * @var string $plugin_url
50
+	 */
51
+	private $plugin_url;
52
+
53
+
54
+
55
+	/**
56
+	 * Initializes internal properties.
57
+	 *
58
+	 * @param FilePath $plugin_file
59
+	 * @param Version  $version
60
+	 * @throws InvalidArgumentException
61
+	 * @throws DomainException
62
+	 */
63
+	public function __construct(FilePath $plugin_file, Version $version)
64
+	{
65
+		$this->plugin_file = $plugin_file;
66
+		$this->version = $version;
67
+		$this->plugin_basename = plugin_basename($this->pluginFile());
68
+		$this->plugin_path = plugin_dir_path($this->pluginFile());
69
+		$this->plugin_url = plugin_dir_url($this->pluginFile());
70
+	}
71
+
72
+
73
+	/**
74
+	 * @return string
75
+	 */
76
+	public function pluginFile()
77
+	{
78
+		return (string) $this->plugin_file;
79
+	}
80
+
81
+
82
+
83
+	/**
84
+	 * @return string
85
+	 */
86
+	public function pluginBasename()
87
+	{
88
+		return $this->plugin_basename;
89
+	}
90
+
91
+
92
+
93
+	/**
94
+	 * @return string
95
+	 */
96
+	public function pluginPath()
97
+	{
98
+		return $this->plugin_path;
99
+	}
100
+
101
+
102
+
103
+	/**
104
+	 * @return string
105
+	 */
106
+	public function pluginUrl()
107
+	{
108
+		return $this->plugin_url;
109
+	}
110
+
111
+
112
+
113
+	/**
114
+	 * @return string
115
+	 */
116
+	public function version()
117
+	{
118
+		return (string) $this->version;
119
+	}
120
+
121
+
122
+
123
+	/**
124
+	 * @return Version
125
+	 */
126
+	public function versionValueObject()
127
+	{
128
+		return $this->version;
129
+	}
130 130
 
131 131
 
132 132
 }
Please login to merge, or discard this patch.