Completed
Branch dependabot/npm_and_yarn/wordpr... (e552b3)
by
unknown
84:27 queued 76:28
created
core/services/notices/AdminNotice.php 2 patches
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -13,119 +13,119 @@
 block discarded – undo
13 13
 class AdminNotice
14 14
 {
15 15
 
16
-    const ERROR = 'notice-error';
17
-
18
-    const WARNING = 'notice-warning';
19
-
20
-    const SUCCESS = 'notice-success';
21
-
22
-    const INFORMATION = 'notice-info';
23
-
24
-    const DISMISSABLE = ' is-dismissible';
25
-
26
-    /**
27
-     * generic system notice to be converted into a WP admin notice
28
-     *
29
-     * @var NoticeInterface $notice
30
-     */
31
-    private $notice;
32
-
33
-
34
-    /**
35
-     * AdminNotice constructor.
36
-     *
37
-     * @param NoticeInterface $notice
38
-     * @param bool            $display_now
39
-     */
40
-    public function __construct(NoticeInterface $notice, $display_now = true)
41
-    {
42
-        $this->notice = $notice;
43
-        if (! did_action('admin_notices')) {
44
-            add_action('admin_notices', array($this, 'displayNotice'));
45
-        } elseif ($display_now) {
46
-            $this->displayNotice();
47
-        }
48
-    }
49
-
50
-
51
-    /**
52
-     * @return void
53
-     */
54
-    public function displayNotice()
55
-    {
56
-        echo $this->getNotice();
57
-    }
58
-
59
-
60
-    /**
61
-     * produces something  like:
62
-     *  <div class="notice notice-success is-dismissible event-espresso-admin-notice">
63
-     *      <p>YOU DID IT!</p>
64
-     *      <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this
65
-     *      notice.</span></button>
66
-     *  </div>
67
-     *
68
-     * @return string
69
-     */
70
-    public function getNotice()
71
-    {
72
-        return sprintf(
73
-            '<div class="notice %1$s%2$s event-espresso-admin-notice"><p>%3$s</p></div>',
74
-            $this->getType(),
75
-            $this->notice->isDismissible() ? AdminNotice::DISMISSABLE : '',
76
-            $this->getMessage()
77
-        );
78
-    }
79
-
80
-
81
-    /**
82
-     * @return string
83
-     */
84
-    private function getType()
85
-    {
86
-        switch ($this->notice->type()) {
87
-            case Notice::ERROR:
88
-                return AdminNotice::ERROR;
89
-                break;
90
-            case Notice::ATTENTION:
91
-                return AdminNotice::WARNING;
92
-                break;
93
-            case Notice::SUCCESS:
94
-                return AdminNotice::SUCCESS;
95
-                break;
96
-            case Notice::INFORMATION:
97
-            default:
98
-                return AdminNotice::INFORMATION;
99
-                break;
100
-        }
101
-    }
102
-
103
-
104
-    /**
105
-     * @return string
106
-     */
107
-    protected function getMessage()
108
-    {
109
-        $message = $this->notice->message();
110
-        if (WP_DEBUG && $this->getType() === AdminNotice::ERROR) {
111
-            $message .= '<br/><span class="tiny-text">' . $this->generateErrorCode() . '</span>';
112
-        }
113
-        return $message;
114
-    }
115
-
116
-
117
-    /**
118
-     * create error code from filepath, function name,
119
-     * and line number where notice was generated
120
-     *
121
-     * @return string
122
-     */
123
-    protected function generateErrorCode()
124
-    {
125
-        $file = explode('.', basename($this->notice->file()));
126
-        $error_code = ! empty($file[0]) ? $file[0] : '';
127
-        $error_code .= ! empty($error_code) ? ' - ' . $this->notice->func() : $this->notice->func();
128
-        $error_code .= ' - ' . $this->notice->line();
129
-        return $error_code;
130
-    }
16
+	const ERROR = 'notice-error';
17
+
18
+	const WARNING = 'notice-warning';
19
+
20
+	const SUCCESS = 'notice-success';
21
+
22
+	const INFORMATION = 'notice-info';
23
+
24
+	const DISMISSABLE = ' is-dismissible';
25
+
26
+	/**
27
+	 * generic system notice to be converted into a WP admin notice
28
+	 *
29
+	 * @var NoticeInterface $notice
30
+	 */
31
+	private $notice;
32
+
33
+
34
+	/**
35
+	 * AdminNotice constructor.
36
+	 *
37
+	 * @param NoticeInterface $notice
38
+	 * @param bool            $display_now
39
+	 */
40
+	public function __construct(NoticeInterface $notice, $display_now = true)
41
+	{
42
+		$this->notice = $notice;
43
+		if (! did_action('admin_notices')) {
44
+			add_action('admin_notices', array($this, 'displayNotice'));
45
+		} elseif ($display_now) {
46
+			$this->displayNotice();
47
+		}
48
+	}
49
+
50
+
51
+	/**
52
+	 * @return void
53
+	 */
54
+	public function displayNotice()
55
+	{
56
+		echo $this->getNotice();
57
+	}
58
+
59
+
60
+	/**
61
+	 * produces something  like:
62
+	 *  <div class="notice notice-success is-dismissible event-espresso-admin-notice">
63
+	 *      <p>YOU DID IT!</p>
64
+	 *      <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this
65
+	 *      notice.</span></button>
66
+	 *  </div>
67
+	 *
68
+	 * @return string
69
+	 */
70
+	public function getNotice()
71
+	{
72
+		return sprintf(
73
+			'<div class="notice %1$s%2$s event-espresso-admin-notice"><p>%3$s</p></div>',
74
+			$this->getType(),
75
+			$this->notice->isDismissible() ? AdminNotice::DISMISSABLE : '',
76
+			$this->getMessage()
77
+		);
78
+	}
79
+
80
+
81
+	/**
82
+	 * @return string
83
+	 */
84
+	private function getType()
85
+	{
86
+		switch ($this->notice->type()) {
87
+			case Notice::ERROR:
88
+				return AdminNotice::ERROR;
89
+				break;
90
+			case Notice::ATTENTION:
91
+				return AdminNotice::WARNING;
92
+				break;
93
+			case Notice::SUCCESS:
94
+				return AdminNotice::SUCCESS;
95
+				break;
96
+			case Notice::INFORMATION:
97
+			default:
98
+				return AdminNotice::INFORMATION;
99
+				break;
100
+		}
101
+	}
102
+
103
+
104
+	/**
105
+	 * @return string
106
+	 */
107
+	protected function getMessage()
108
+	{
109
+		$message = $this->notice->message();
110
+		if (WP_DEBUG && $this->getType() === AdminNotice::ERROR) {
111
+			$message .= '<br/><span class="tiny-text">' . $this->generateErrorCode() . '</span>';
112
+		}
113
+		return $message;
114
+	}
115
+
116
+
117
+	/**
118
+	 * create error code from filepath, function name,
119
+	 * and line number where notice was generated
120
+	 *
121
+	 * @return string
122
+	 */
123
+	protected function generateErrorCode()
124
+	{
125
+		$file = explode('.', basename($this->notice->file()));
126
+		$error_code = ! empty($file[0]) ? $file[0] : '';
127
+		$error_code .= ! empty($error_code) ? ' - ' . $this->notice->func() : $this->notice->func();
128
+		$error_code .= ' - ' . $this->notice->line();
129
+		return $error_code;
130
+	}
131 131
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function __construct(NoticeInterface $notice, $display_now = true)
41 41
     {
42 42
         $this->notice = $notice;
43
-        if (! did_action('admin_notices')) {
43
+        if ( ! did_action('admin_notices')) {
44 44
             add_action('admin_notices', array($this, 'displayNotice'));
45 45
         } elseif ($display_now) {
46 46
             $this->displayNotice();
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $message = $this->notice->message();
110 110
         if (WP_DEBUG && $this->getType() === AdminNotice::ERROR) {
111
-            $message .= '<br/><span class="tiny-text">' . $this->generateErrorCode() . '</span>';
111
+            $message .= '<br/><span class="tiny-text">'.$this->generateErrorCode().'</span>';
112 112
         }
113 113
         return $message;
114 114
     }
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $file = explode('.', basename($this->notice->file()));
126 126
         $error_code = ! empty($file[0]) ? $file[0] : '';
127
-        $error_code .= ! empty($error_code) ? ' - ' . $this->notice->func() : $this->notice->func();
128
-        $error_code .= ' - ' . $this->notice->line();
127
+        $error_code .= ! empty($error_code) ? ' - '.$this->notice->func() : $this->notice->func();
128
+        $error_code .= ' - '.$this->notice->line();
129 129
         return $error_code;
130 130
     }
131 131
 }
Please login to merge, or discard this patch.
core/services/notices/NoticesContainer.php 1 patch
Indentation   +214 added lines, -214 removed lines patch added patch discarded remove patch
@@ -15,218 +15,218 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    /**
19
-     * @var NoticeInterface[] $information
20
-     */
21
-    private $information = array();
22
-
23
-
24
-    /**
25
-     * @var NoticeInterface[] $attention
26
-     */
27
-    private $attention = array();
28
-
29
-
30
-    /**
31
-     * @var NoticeInterface[] $error
32
-     */
33
-    private $error = array();
34
-
35
-
36
-    /**
37
-     * @var NoticeInterface[] $success
38
-     */
39
-    private $success = array();
40
-
41
-
42
-    /**
43
-     * @param string $notice
44
-     * @param bool   $dismissible
45
-     * @param string $file
46
-     * @param string $func
47
-     * @param string $line
48
-     * @throws InvalidDataTypeException
49
-     */
50
-    public function addInformation($notice, $dismissible = true, $file = '', $func = '', $line = '')
51
-    {
52
-        $this->information[] = new Notice(
53
-            Notice::INFORMATION,
54
-            $notice,
55
-            $dismissible,
56
-            $file,
57
-            $func,
58
-            $line
59
-        );
60
-    }
61
-
62
-
63
-    /**
64
-     * @param string $notice
65
-     * @param bool   $dismissible
66
-     * @param string $file
67
-     * @param string $func
68
-     * @param string $line
69
-     * @throws InvalidDataTypeException
70
-     */
71
-    public function addAttention($notice, $dismissible = true, $file = '', $func = '', $line = '')
72
-    {
73
-        $this->attention[] = new Notice(
74
-            Notice::ATTENTION,
75
-            $notice,
76
-            $dismissible,
77
-            $file,
78
-            $func,
79
-            $line
80
-        );
81
-    }
82
-
83
-    // phpcs:disable PEAR.Functions.ValidDefaultValue.NotAtEnd
84
-    /**
85
-     * @param string $notice
86
-     * @param bool   $dismissible
87
-     * @param string $file
88
-     * @param string $func
89
-     * @param string $line
90
-     * @throws InvalidDataTypeException
91
-     */
92
-    public function addError($notice, $dismissible = true, $file, $func, $line)
93
-    {
94
-        $this->error[] = new Notice(
95
-            Notice::ERROR,
96
-            $notice,
97
-            $dismissible,
98
-            $file,
99
-            $func,
100
-            $line
101
-        );
102
-    }
103
-
104
-
105
-    /**
106
-     * @param string $notice
107
-     * @param bool   $dismissible
108
-     * @param string $file
109
-     * @param string $func
110
-     * @param string $line
111
-     * @throws InvalidDataTypeException
112
-     */
113
-    public function addSuccess($notice, $dismissible = true, $file = '', $func = '', $line = '')
114
-    {
115
-        $this->success[] = new Notice(
116
-            Notice::SUCCESS,
117
-            $notice,
118
-            $dismissible,
119
-            $file,
120
-            $func,
121
-            $line
122
-        );
123
-    }
124
-
125
-
126
-    /**
127
-     * @return boolean
128
-     */
129
-    public function hasInformation()
130
-    {
131
-        return ! empty($this->information);
132
-    }
133
-
134
-
135
-    /**
136
-     * @return boolean
137
-     */
138
-    public function hasAttention()
139
-    {
140
-        return ! empty($this->attention);
141
-    }
142
-
143
-
144
-    /**
145
-     * @return boolean
146
-     */
147
-    public function hasError()
148
-    {
149
-        return ! empty($this->error);
150
-    }
151
-
152
-
153
-    /**
154
-     * @return boolean
155
-     */
156
-    public function hasSuccess()
157
-    {
158
-        return ! empty($this->success);
159
-    }
160
-
161
-
162
-    /**
163
-     * @return int
164
-     */
165
-    public function countInformation()
166
-    {
167
-        return count($this->information);
168
-    }
169
-
170
-
171
-    /**
172
-     * @return int
173
-     */
174
-    public function countAttention()
175
-    {
176
-        return count($this->attention);
177
-    }
178
-
179
-
180
-    /**
181
-     * @return int
182
-     */
183
-    public function countError()
184
-    {
185
-        return count($this->error);
186
-    }
187
-
188
-
189
-    /**
190
-     * @return int
191
-     */
192
-    public function countSuccess()
193
-    {
194
-        return count($this->success);
195
-    }
196
-
197
-
198
-    /**
199
-     * @return NoticeInterface[]
200
-     */
201
-    public function getInformation()
202
-    {
203
-        return $this->information;
204
-    }
205
-
206
-
207
-    /**
208
-     * @return NoticeInterface[]
209
-     */
210
-    public function getAttention()
211
-    {
212
-        return $this->attention;
213
-    }
214
-
215
-
216
-    /**
217
-     * @return NoticeInterface[]
218
-     */
219
-    public function getError()
220
-    {
221
-        return $this->error;
222
-    }
223
-
224
-
225
-    /**
226
-     * @return NoticeInterface[]
227
-     */
228
-    public function getSuccess()
229
-    {
230
-        return $this->success;
231
-    }
18
+	/**
19
+	 * @var NoticeInterface[] $information
20
+	 */
21
+	private $information = array();
22
+
23
+
24
+	/**
25
+	 * @var NoticeInterface[] $attention
26
+	 */
27
+	private $attention = array();
28
+
29
+
30
+	/**
31
+	 * @var NoticeInterface[] $error
32
+	 */
33
+	private $error = array();
34
+
35
+
36
+	/**
37
+	 * @var NoticeInterface[] $success
38
+	 */
39
+	private $success = array();
40
+
41
+
42
+	/**
43
+	 * @param string $notice
44
+	 * @param bool   $dismissible
45
+	 * @param string $file
46
+	 * @param string $func
47
+	 * @param string $line
48
+	 * @throws InvalidDataTypeException
49
+	 */
50
+	public function addInformation($notice, $dismissible = true, $file = '', $func = '', $line = '')
51
+	{
52
+		$this->information[] = new Notice(
53
+			Notice::INFORMATION,
54
+			$notice,
55
+			$dismissible,
56
+			$file,
57
+			$func,
58
+			$line
59
+		);
60
+	}
61
+
62
+
63
+	/**
64
+	 * @param string $notice
65
+	 * @param bool   $dismissible
66
+	 * @param string $file
67
+	 * @param string $func
68
+	 * @param string $line
69
+	 * @throws InvalidDataTypeException
70
+	 */
71
+	public function addAttention($notice, $dismissible = true, $file = '', $func = '', $line = '')
72
+	{
73
+		$this->attention[] = new Notice(
74
+			Notice::ATTENTION,
75
+			$notice,
76
+			$dismissible,
77
+			$file,
78
+			$func,
79
+			$line
80
+		);
81
+	}
82
+
83
+	// phpcs:disable PEAR.Functions.ValidDefaultValue.NotAtEnd
84
+	/**
85
+	 * @param string $notice
86
+	 * @param bool   $dismissible
87
+	 * @param string $file
88
+	 * @param string $func
89
+	 * @param string $line
90
+	 * @throws InvalidDataTypeException
91
+	 */
92
+	public function addError($notice, $dismissible = true, $file, $func, $line)
93
+	{
94
+		$this->error[] = new Notice(
95
+			Notice::ERROR,
96
+			$notice,
97
+			$dismissible,
98
+			$file,
99
+			$func,
100
+			$line
101
+		);
102
+	}
103
+
104
+
105
+	/**
106
+	 * @param string $notice
107
+	 * @param bool   $dismissible
108
+	 * @param string $file
109
+	 * @param string $func
110
+	 * @param string $line
111
+	 * @throws InvalidDataTypeException
112
+	 */
113
+	public function addSuccess($notice, $dismissible = true, $file = '', $func = '', $line = '')
114
+	{
115
+		$this->success[] = new Notice(
116
+			Notice::SUCCESS,
117
+			$notice,
118
+			$dismissible,
119
+			$file,
120
+			$func,
121
+			$line
122
+		);
123
+	}
124
+
125
+
126
+	/**
127
+	 * @return boolean
128
+	 */
129
+	public function hasInformation()
130
+	{
131
+		return ! empty($this->information);
132
+	}
133
+
134
+
135
+	/**
136
+	 * @return boolean
137
+	 */
138
+	public function hasAttention()
139
+	{
140
+		return ! empty($this->attention);
141
+	}
142
+
143
+
144
+	/**
145
+	 * @return boolean
146
+	 */
147
+	public function hasError()
148
+	{
149
+		return ! empty($this->error);
150
+	}
151
+
152
+
153
+	/**
154
+	 * @return boolean
155
+	 */
156
+	public function hasSuccess()
157
+	{
158
+		return ! empty($this->success);
159
+	}
160
+
161
+
162
+	/**
163
+	 * @return int
164
+	 */
165
+	public function countInformation()
166
+	{
167
+		return count($this->information);
168
+	}
169
+
170
+
171
+	/**
172
+	 * @return int
173
+	 */
174
+	public function countAttention()
175
+	{
176
+		return count($this->attention);
177
+	}
178
+
179
+
180
+	/**
181
+	 * @return int
182
+	 */
183
+	public function countError()
184
+	{
185
+		return count($this->error);
186
+	}
187
+
188
+
189
+	/**
190
+	 * @return int
191
+	 */
192
+	public function countSuccess()
193
+	{
194
+		return count($this->success);
195
+	}
196
+
197
+
198
+	/**
199
+	 * @return NoticeInterface[]
200
+	 */
201
+	public function getInformation()
202
+	{
203
+		return $this->information;
204
+	}
205
+
206
+
207
+	/**
208
+	 * @return NoticeInterface[]
209
+	 */
210
+	public function getAttention()
211
+	{
212
+		return $this->attention;
213
+	}
214
+
215
+
216
+	/**
217
+	 * @return NoticeInterface[]
218
+	 */
219
+	public function getError()
220
+	{
221
+		return $this->error;
222
+	}
223
+
224
+
225
+	/**
226
+	 * @return NoticeInterface[]
227
+	 */
228
+	public function getSuccess()
229
+	{
230
+		return $this->success;
231
+	}
232 232
 }
Please login to merge, or discard this patch.
core/services/container/CoffeeMill.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -15,59 +15,59 @@
 block discarded – undo
15 15
 class CoffeeMill
16 16
 {
17 17
 
18
-    /**
19
-     * @var CoffeeShop $coffee_shop
20
-     */
21
-    private static $coffee_shop;
18
+	/**
19
+	 * @var CoffeeShop $coffee_shop
20
+	 */
21
+	private static $coffee_shop;
22 22
 
23 23
 
24
-    /**
25
-     * @return mixed
26
-     */
27
-    public static function getCoffeeShop()
28
-    {
29
-        return self::$coffee_shop;
30
-    }
24
+	/**
25
+	 * @return mixed
26
+	 */
27
+	public static function getCoffeeShop()
28
+	{
29
+		return self::$coffee_shop;
30
+	}
31 31
 
32 32
 
33
-    /**
34
-     * @param CoffeeShop $coffee_shop
35
-     */
36
-    public static function setCoffeeShop(CoffeeShop $coffee_shop)
37
-    {
38
-        self::$coffee_shop = $coffee_shop;
39
-    }
33
+	/**
34
+	 * @param CoffeeShop $coffee_shop
35
+	 */
36
+	public static function setCoffeeShop(CoffeeShop $coffee_shop)
37
+	{
38
+		self::$coffee_shop = $coffee_shop;
39
+	}
40 40
 
41 41
 
42
-    /**
43
-     * @param string $identifier
44
-     * @param array  $arguments
45
-     * @param string $type
46
-     * @return mixed
47
-     * @throws ServiceNotFoundException
48
-     */
49
-    public static function createNew($identifier, $arguments = array(), $type = CoffeeMaker::BREW_NEW)
50
-    {
51
-        return self::$coffee_shop->brew($identifier, $arguments, $type);
52
-    }
42
+	/**
43
+	 * @param string $identifier
44
+	 * @param array  $arguments
45
+	 * @param string $type
46
+	 * @return mixed
47
+	 * @throws ServiceNotFoundException
48
+	 */
49
+	public static function createNew($identifier, $arguments = array(), $type = CoffeeMaker::BREW_NEW)
50
+	{
51
+		return self::$coffee_shop->brew($identifier, $arguments, $type);
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * IMPORTANT!!!
57
-     * Usage of this method is discouraged as it promotes service location.
58
-     * It's current use is only as a stop gap measure until the CoffeeShop
59
-     * Dependency Injection Container can be implemented properly for all classes.
60
-     * If it is at all possible, inject your dependencies via your class constructor.
61
-     * This method WILL BE DEPRECATED at some point in the near future.
62
-     *
63
-     * @param string $identifier
64
-     * @param array  $arguments
65
-     * @param string $type
66
-     * @return mixed
67
-     * @throws ServiceNotFoundException
68
-     */
69
-    public static function getService($identifier, $arguments = array(), $type = CoffeeMaker::BREW_SHARED)
70
-    {
71
-        return self::$coffee_shop->brew($identifier, $arguments, $type);
72
-    }
55
+	/**
56
+	 * IMPORTANT!!!
57
+	 * Usage of this method is discouraged as it promotes service location.
58
+	 * It's current use is only as a stop gap measure until the CoffeeShop
59
+	 * Dependency Injection Container can be implemented properly for all classes.
60
+	 * If it is at all possible, inject your dependencies via your class constructor.
61
+	 * This method WILL BE DEPRECATED at some point in the near future.
62
+	 *
63
+	 * @param string $identifier
64
+	 * @param array  $arguments
65
+	 * @param string $type
66
+	 * @return mixed
67
+	 * @throws ServiceNotFoundException
68
+	 */
69
+	public static function getService($identifier, $arguments = array(), $type = CoffeeMaker::BREW_SHARED)
70
+	{
71
+		return self::$coffee_shop->brew($identifier, $arguments, $type);
72
+	}
73 73
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/InstantiationException.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,25 +15,25 @@
 block discarded – undo
15 15
 class InstantiationException extends BadMethodCallException
16 16
 {
17 17
 
18
-    /**
19
-     * InstantiationException constructor.
20
-     *
21
-     * @param string     $identifier the name of the requested entity or service
22
-     * @param string     $message
23
-     * @param int        $code
24
-     * @param \Exception $previous
25
-     */
26
-    public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
27
-    {
28
-        if (empty($message)) {
29
-            $message = sprintf(
30
-                __(
31
-                    'The "%1$s" class could not be constructed.',
32
-                    'event_espresso'
33
-                ),
34
-                $identifier
35
-            );
36
-        }
37
-        parent::__construct($message, $code, $previous);
38
-    }
18
+	/**
19
+	 * InstantiationException constructor.
20
+	 *
21
+	 * @param string     $identifier the name of the requested entity or service
22
+	 * @param string     $message
23
+	 * @param int        $code
24
+	 * @param \Exception $previous
25
+	 */
26
+	public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
27
+	{
28
+		if (empty($message)) {
29
+			$message = sprintf(
30
+				__(
31
+					'The "%1$s" class could not be constructed.',
32
+					'event_espresso'
33
+				),
34
+				$identifier
35
+			);
36
+		}
37
+		parent::__construct($message, $code, $previous);
38
+	}
39 39
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/ServiceExistsException.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -14,26 +14,26 @@
 block discarded – undo
14 14
 {
15 15
 
16 16
 
17
-    /**
18
-     * ServiceExistsException constructor
19
-     *
20
-     * @param string     $service_name the name of the requested service
21
-     * @param string     $message
22
-     * @param int        $code
23
-     * @param \Exception $previous
24
-     */
25
-    public function __construct(
26
-        $service_name,
27
-        $message = '',
28
-        $code = 0,
29
-        \Exception $previous = null
30
-    ) {
31
-        if (empty($message)) {
32
-            $message = sprintf(
33
-                __('The "%1$s" service already exists in the CoffeeShop and can not be added again.', 'event_espresso'),
34
-                $service_name
35
-            );
36
-        }
37
-        parent::__construct($message, $code, $previous);
38
-    }
17
+	/**
18
+	 * ServiceExistsException constructor
19
+	 *
20
+	 * @param string     $service_name the name of the requested service
21
+	 * @param string     $message
22
+	 * @param int        $code
23
+	 * @param \Exception $previous
24
+	 */
25
+	public function __construct(
26
+		$service_name,
27
+		$message = '',
28
+		$code = 0,
29
+		\Exception $previous = null
30
+	) {
31
+		if (empty($message)) {
32
+			$message = sprintf(
33
+				__('The "%1$s" service already exists in the CoffeeShop and can not be added again.', 'event_espresso'),
34
+				$service_name
35
+			);
36
+		}
37
+		parent::__construct($message, $code, $previous);
38
+	}
39 39
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/ServiceNotFoundException.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 block discarded – undo
12 12
 class ServiceNotFoundException extends \RuntimeException
13 13
 {
14 14
 
15
-    /**
16
-     * ServiceNotFoundException constructor
17
-     *
18
-     * @param string     $service_name the name of the requested service
19
-     * @param string     $message
20
-     * @param int        $code
21
-     * @param \Exception $previous
22
-     */
23
-    public function __construct(
24
-        $service_name,
25
-        $message = '',
26
-        $code = 0,
27
-        \Exception $previous = null
28
-    ) {
29
-        if (empty($message)) {
30
-            $message = sprintf(
31
-                __('The requested service "%1$s" could not found be found in the CoffeeShop.', 'event_espresso'),
32
-                $service_name
33
-            );
34
-        }
35
-        parent::__construct($message, $code, $previous);
36
-    }
15
+	/**
16
+	 * ServiceNotFoundException constructor
17
+	 *
18
+	 * @param string     $service_name the name of the requested service
19
+	 * @param string     $message
20
+	 * @param int        $code
21
+	 * @param \Exception $previous
22
+	 */
23
+	public function __construct(
24
+		$service_name,
25
+		$message = '',
26
+		$code = 0,
27
+		\Exception $previous = null
28
+	) {
29
+		if (empty($message)) {
30
+			$message = sprintf(
31
+				__('The requested service "%1$s" could not found be found in the CoffeeShop.', 'event_espresso'),
32
+				$service_name
33
+			);
34
+		}
35
+		parent::__construct($message, $code, $previous);
36
+	}
37 37
 }
Please login to merge, or discard this patch.
core/services/container/exceptions/InvalidServiceException.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -13,27 +13,27 @@
 block discarded – undo
13 13
 class InvalidServiceException extends \UnexpectedValueException
14 14
 {
15 15
 
16
-    /**
17
-     * InvalidServiceException constructor.
18
-     *
19
-     * @param string     $service_name the name of the requested service
20
-     * @param string     $actual       classname of what we got
21
-     * @param string     $message
22
-     * @param int        $code
23
-     * @param \Exception $previous
24
-     */
25
-    public function __construct($service_name, $actual, $message = '', $code = 0, \Exception $previous = null)
26
-    {
27
-        if (empty($message)) {
28
-            $message = sprintf(
29
-                __(
30
-                    'The "%1$s" service could not be retrieved from the CoffeeShop, but "%2$s" was received.',
31
-                    'event_espresso'
32
-                ),
33
-                $service_name,
34
-                print_r($actual, true)
35
-            );
36
-        }
37
-        parent::__construct($message, $code, $previous);
38
-    }
16
+	/**
17
+	 * InvalidServiceException constructor.
18
+	 *
19
+	 * @param string     $service_name the name of the requested service
20
+	 * @param string     $actual       classname of what we got
21
+	 * @param string     $message
22
+	 * @param int        $code
23
+	 * @param \Exception $previous
24
+	 */
25
+	public function __construct($service_name, $actual, $message = '', $code = 0, \Exception $previous = null)
26
+	{
27
+		if (empty($message)) {
28
+			$message = sprintf(
29
+				__(
30
+					'The "%1$s" service could not be retrieved from the CoffeeShop, but "%2$s" was received.',
31
+					'event_espresso'
32
+				),
33
+				$service_name,
34
+				print_r($actual, true)
35
+			);
36
+		}
37
+		parent::__construct($message, $code, $previous);
38
+	}
39 39
 }
Please login to merge, or discard this patch.
core/services/container/NewCoffeeMaker.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -20,51 +20,51 @@
 block discarded – undo
20 20
 {
21 21
 
22 22
 
23
-    /**
24
-     * @return string
25
-     */
26
-    public function type()
27
-    {
28
-        return CoffeeMaker::BREW_NEW;
29
-    }
23
+	/**
24
+	 * @return string
25
+	 */
26
+	public function type()
27
+	{
28
+		return CoffeeMaker::BREW_NEW;
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @param RecipeInterface $recipe
34
-     * @param array           $arguments
35
-     * @return mixed
36
-     */
37
-    public function brew(RecipeInterface $recipe, $arguments = array())
38
-    {
39
-        $this->resolveClassAndFilepath($recipe);
40
-        $reflector = $this->injector()->getReflectionClass($recipe->fqcn());
41
-        $method = $this->resolveInstantiationMethod($reflector);
42
-        switch ($method) {
43
-            case 'instance':
44
-            case 'new_instance':
45
-            case 'new_instance_from_db':
46
-                $injector = $this->injector();
47
-                $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) {
48
-                    return call_user_func_array(
49
-                        array($reflector->getName(), $method),
50
-                        $injector->resolveDependencies($recipe, $reflector, $arguments)
51
-                    );
52
-                };
53
-                break;
54
-            case 'newInstance':
55
-                $closure = function () use ($reflector) {
56
-                    return $reflector->newInstance();
57
-                };
58
-                break;
59
-            case 'newInstanceArgs':
60
-            default:
61
-                $injector = $this->injector();
62
-                $closure = function ($arguments) use ($recipe, $reflector, $injector) {
63
-                    return $reflector->newInstanceArgs(
64
-                        $injector->resolveDependencies($recipe, $reflector, $arguments)
65
-                    );
66
-                };
67
-        }
68
-        return $this->coffeePot()->addClosure($recipe->identifier(), $closure);
69
-    }
32
+	/**
33
+	 * @param RecipeInterface $recipe
34
+	 * @param array           $arguments
35
+	 * @return mixed
36
+	 */
37
+	public function brew(RecipeInterface $recipe, $arguments = array())
38
+	{
39
+		$this->resolveClassAndFilepath($recipe);
40
+		$reflector = $this->injector()->getReflectionClass($recipe->fqcn());
41
+		$method = $this->resolveInstantiationMethod($reflector);
42
+		switch ($method) {
43
+			case 'instance':
44
+			case 'new_instance':
45
+			case 'new_instance_from_db':
46
+				$injector = $this->injector();
47
+				$closure = function ($arguments) use ($recipe, $reflector, $method, $injector) {
48
+					return call_user_func_array(
49
+						array($reflector->getName(), $method),
50
+						$injector->resolveDependencies($recipe, $reflector, $arguments)
51
+					);
52
+				};
53
+				break;
54
+			case 'newInstance':
55
+				$closure = function () use ($reflector) {
56
+					return $reflector->newInstance();
57
+				};
58
+				break;
59
+			case 'newInstanceArgs':
60
+			default:
61
+				$injector = $this->injector();
62
+				$closure = function ($arguments) use ($recipe, $reflector, $injector) {
63
+					return $reflector->newInstanceArgs(
64
+						$injector->resolveDependencies($recipe, $reflector, $arguments)
65
+					);
66
+				};
67
+		}
68
+		return $this->coffeePot()->addClosure($recipe->identifier(), $closure);
69
+	}
70 70
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             case 'new_instance':
45 45
             case 'new_instance_from_db':
46 46
                 $injector = $this->injector();
47
-                $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) {
47
+                $closure = function($arguments) use ($recipe, $reflector, $method, $injector) {
48 48
                     return call_user_func_array(
49 49
                         array($reflector->getName(), $method),
50 50
                         $injector->resolveDependencies($recipe, $reflector, $arguments)
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
                 };
53 53
                 break;
54 54
             case 'newInstance':
55
-                $closure = function () use ($reflector) {
55
+                $closure = function() use ($reflector) {
56 56
                     return $reflector->newInstance();
57 57
                 };
58 58
                 break;
59 59
             case 'newInstanceArgs':
60 60
             default:
61 61
                 $injector = $this->injector();
62
-                $closure = function ($arguments) use ($recipe, $reflector, $injector) {
62
+                $closure = function($arguments) use ($recipe, $reflector, $injector) {
63 63
                     return $reflector->newInstanceArgs(
64 64
                         $injector->resolveDependencies($recipe, $reflector, $arguments)
65 65
                     );
Please login to merge, or discard this patch.
core/services/container/LoadOnlyCoffeeMaker.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -21,23 +21,23 @@
 block discarded – undo
21 21
 class LoadOnlyCoffeeMaker extends CoffeeMaker
22 22
 {
23 23
 
24
-    /**
25
-     * @return string
26
-     */
27
-    public function type()
28
-    {
29
-        return CoffeeMaker::BREW_LOAD_ONLY;
30
-    }
24
+	/**
25
+	 * @return string
26
+	 */
27
+	public function type()
28
+	{
29
+		return CoffeeMaker::BREW_LOAD_ONLY;
30
+	}
31 31
 
32 32
 
33
-    /**
34
-     * @param RecipeInterface $recipe
35
-     * @param array           $arguments
36
-     * @return mixed
37
-     * @throws InvalidClassException
38
-     */
39
-    public function brew(RecipeInterface $recipe, $arguments = array())
40
-    {
41
-        return $this->resolveClassAndFilepath($recipe);
42
-    }
33
+	/**
34
+	 * @param RecipeInterface $recipe
35
+	 * @param array           $arguments
36
+	 * @return mixed
37
+	 * @throws InvalidClassException
38
+	 */
39
+	public function brew(RecipeInterface $recipe, $arguments = array())
40
+	{
41
+		return $this->resolveClassAndFilepath($recipe);
42
+	}
43 43
 }
Please login to merge, or discard this patch.