@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @param View $view View |
107 | 107 | * @return self |
108 | 108 | */ |
109 | - public function set_view( View $view ): self { |
|
109 | + public function set_view(View $view): self { |
|
110 | 110 | $this->view = $view; |
111 | 111 | return $this; |
112 | 112 | } |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | * @return string |
123 | 123 | */ |
124 | 124 | public function slug(): string { |
125 | - if ( $this->page_slug === '' ) { |
|
126 | - throw Page_Exception::undefined_property( 'page_slug', $this ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
125 | + if ($this->page_slug === '') { |
|
126 | + throw Page_Exception::undefined_property('page_slug', $this); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
127 | 127 | } |
128 | 128 | return $this->page_slug; |
129 | 129 | } |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | * @return string |
133 | 133 | */ |
134 | 134 | public function menu_title(): string { |
135 | - if ( $this->menu_title === '' ) { |
|
136 | - throw Page_Exception::undefined_property( 'menu_title', $this ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
135 | + if ($this->menu_title === '') { |
|
136 | + throw Page_Exception::undefined_property('menu_title', $this); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
137 | 137 | } |
138 | 138 | return $this->menu_title; |
139 | 139 | } |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | * @throws Page_Exception code 201 if template not defined. |
168 | 168 | */ |
169 | 169 | public function render_view(): callable { |
170 | - if ( null === $this->view ) { |
|
171 | - throw Page_Exception::view_not_set( $this ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
170 | + if (null === $this->view) { |
|
171 | + throw Page_Exception::view_not_set($this); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
172 | 172 | } |
173 | 173 | |
174 | - if ( '' === $this->view_template ) { |
|
175 | - throw Page_Exception::undefined_property( 'view_template', $this ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
174 | + if ('' === $this->view_template) { |
|
175 | + throw Page_Exception::undefined_property('view_template', $this); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
176 | 176 | } |
177 | 177 | |
178 | - return function () { |
|
178 | + return function() { |
|
179 | 179 | // @phpstan-ignore-next-line, as we have already checked for null. |
180 | - $this->view->render( $this->view_template, $this->view_data ); |
|
180 | + $this->view->render($this->view_template, $this->view_data); |
|
181 | 181 | }; |
182 | 182 | } |
183 | 183 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * @return void |
189 | 189 | * @codeCoverageIgnore This can be tested as it does nothing and is extended only |
190 | 190 | */ |
191 | - public function enqueue( Page $page ): void { |
|
191 | + public function enqueue(Page $page): void { |
|
192 | 192 | // Do nothing. |
193 | 193 | // Can be extended in any child class that extends. |
194 | 194 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * @return void |
201 | 201 | * @codeCoverageIgnore This can be tested as it does nothing and is extended only |
202 | 202 | */ |
203 | - public function load( Page $page ): void { |
|
203 | + public function load(Page $page): void { |
|
204 | 204 | // Do nothing. |
205 | 205 | // Can be extended in any child class that extends. |
206 | 206 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param string $page_hook |
212 | 212 | * @return void |
213 | 213 | */ |
214 | - final public function set_page_hook( string $page_hook ): void { |
|
214 | + final public function set_page_hook(string $page_hook): void { |
|
215 | 215 | $this->page_hook = $page_hook; |
216 | 216 | } |
217 | 217 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @return bool |
49 | 49 | */ |
50 | 50 | public function has_errors(): bool { |
51 | - return count( $this->errors ) > 0; |
|
51 | + return count($this->errors) > 0; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @param string $error |
67 | 67 | * @return void |
68 | 68 | */ |
69 | - public function push_error( string $error ): void { |
|
69 | + public function push_error(string $error): void { |
|
70 | 70 | $this->errors[] = $error; |
71 | 71 | } |
72 | 72 | |
@@ -76,5 +76,5 @@ discard block |
||
76 | 76 | * @param mixed $subject |
77 | 77 | * @return bool |
78 | 78 | */ |
79 | - abstract public function validate( $subject ): bool; |
|
79 | + abstract public function validate($subject): bool; |
|
80 | 80 | } |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | * @return string |
85 | 85 | */ |
86 | 86 | public function get_group_title(): string { |
87 | - if ( $this->group_title === null ) { |
|
88 | - throw Group_Exception::group_title_undefined( $this ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
87 | + if ($this->group_title === null) { |
|
88 | + throw Group_Exception::group_title_undefined($this); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
89 | 89 | } |
90 | 90 | return $this->group_title; |
91 | 91 | } |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | * @return string |
115 | 115 | */ |
116 | 116 | public function get_primary_page(): string { |
117 | - if ( $this->primary_page === null ) { |
|
118 | - throw Group_Exception::primary_page_undefined( $this ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
117 | + if ($this->primary_page === null) { |
|
118 | + throw Group_Exception::primary_page_undefined($this); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped, escaped in exception. |
|
119 | 119 | } |
120 | 120 | return $this->primary_page; |
121 | 121 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @return void |
147 | 147 | * @codeCoverageIgnore This can't be tested as it does nothing and is extended only |
148 | 148 | */ |
149 | - public function enqueue( Abstract_Group $group, Page $page ): void { |
|
149 | + public function enqueue(Abstract_Group $group, Page $page): void { |
|
150 | 150 | // Do nothing by default. |
151 | 151 | } |
152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @return void |
159 | 159 | * @codeCoverageIgnore This can't be tested as it does nothing and is extended only |
160 | 160 | */ |
161 | - public function load( Abstract_Group $group, Page $page ): void { |
|
161 | + public function load(Abstract_Group $group, Page $page): void { |
|
162 | 162 | // Do nothing by default. |
163 | 163 | } |
164 | 164 | } |