Completed
Push — master ( 7b9919...5cecff )
by Glynn
21s queued 12s
created
src/Page/Page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
 	 * @param Page $page
59 59
 	 * @return void
60 60
 	 */
61
-	public function enqueue( Page $page ): void;
61
+	public function enqueue(Page $page): void;
62 62
 
63 63
 	/**
64 64
 	 * @param Page $page
65 65
 	 * @return void
66 66
 	 */
67
-	public function load( Page $page ): void;
67
+	public function load(Page $page): void;
68 68
 
69 69
 	/**
70 70
 	 * @return ?string
Please login to merge, or discard this patch.
src/Page/Menu_Page.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
122 122
 	 * @return string
123 123
 	 */
124 124
 	public function slug(): string {
125
-		if ( $this->page_slug === null ) {
126
-			throw Page_Exception::undefined_property( 'page_slug', $this );
125
+		if ($this->page_slug === null) {
126
+			throw Page_Exception::undefined_property('page_slug', $this);
127 127
 		}
128 128
 		return $this->page_slug;
129 129
 	}
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	 * @return string
133 133
 	 */
134 134
 	public function menu_title(): string {
135
-		if ( $this->menu_title === null ) {
136
-			throw Page_Exception::undefined_property( 'menu_title', $this );
135
+		if ($this->menu_title === null) {
136
+			throw Page_Exception::undefined_property('menu_title', $this);
137 137
 		}
138 138
 		return $this->menu_title;
139 139
 	}
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
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 );
170
+		if (null === $this->view) {
171
+			throw Page_Exception::view_not_set($this);
172 172
 		}
173 173
 
174
-		if ( null === $this->view_template ) {
175
-			throw Page_Exception::undefined_property( 'view_template', $this );
174
+		if (null === $this->view_template) {
175
+			throw Page_Exception::undefined_property('view_template', $this);
176 176
 		}
177 177
 
178 178
 		return function() {
179
-			$this->view->render( $this->view_template, $this->view_data );
179
+			$this->view->render($this->view_template, $this->view_data);
180 180
 		};
181 181
 
182 182
 	}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Registrar/Registrar.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	 * @param \PinkCrab\Perique_Admin_Menu\Group\Abstract_Group|null $group
42 42
 	 * @return void
43 43
 	 */
44
-	public function register_primary( Page $page, ?Abstract_Group $group = null ): void {
44
+	public function register_primary(Page $page, ?Abstract_Group $group = null): void {
45 45
 
46
-		switch ( true ) {
46
+		switch (true) {
47 47
 			// For menu pages
48 48
 			case $page instanceof Menu_Page:
49 49
 				/** @var Menu_Page $page */
@@ -56,20 +56,20 @@  discard block
 block discarded – undo
56 56
 					$page->slug(),
57 57
 					$page->render_view(),
58 58
 					$group ? $group->get_icon() : '',
59
-					(int) ( $group ? $group->get_position() : $page->position() )
59
+					(int) ($group ? $group->get_position() : $page->position())
60 60
 				);
61 61
 
62
-				$page->set_page_hook( $hook );
62
+				$page->set_page_hook($hook);
63 63
 
64 64
 				// Register Enqueue hooks for page/group.
65
-				$this->enqueue_scripts( $hook, $page, $group );
65
+				$this->enqueue_scripts($hook, $page, $group);
66 66
 				// Register hook for pre-load page
67
-				$this->pre_load_hook( $hook, $page, $group );
67
+				$this->pre_load_hook($hook, $page, $group);
68 68
 
69 69
 				break;
70 70
 
71 71
 			default:
72
-				do_action( Hooks::PAGE_REGISTRAR_PRIMARY, $page, $group );
72
+				do_action(Hooks::PAGE_REGISTRAR_PRIMARY, $page, $group);
73 73
 		}
74 74
 	}
75 75
 
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	 * @param \PinkCrab\Perique_Admin_Menu\Group\Abstract_Group|null $group
82 82
 	 * @return void
83 83
 	 */
84
-	public function register_subpage( Page $page, string $parent_slug, ?Abstract_Group $group = null ): void {
85
-		switch ( true ) {
84
+	public function register_subpage(Page $page, string $parent_slug, ?Abstract_Group $group = null): void {
85
+		switch (true) {
86 86
 			case $page instanceof Menu_Page:
87 87
 				/** @var Menu_Page $page */
88 88
 				$page = $page;
@@ -98,22 +98,22 @@  discard block
 block discarded – undo
98 98
 				);
99 99
 
100 100
 				// If the sub page cant be registered because of permissions. Then we need to register the page as a primary page.
101
-				if ( ! is_string( $hook ) ) {
101
+				if ( ! is_string($hook)) {
102 102
 					return;
103 103
 				}
104 104
 
105 105
 				// Set the pages hook.
106
-				$page->set_page_hook( $hook );
106
+				$page->set_page_hook($hook);
107 107
 
108 108
 				// Register Enqueue hooks for page/group.
109
-				$this->enqueue_scripts( $page->page_hook() ?? $hook, $page, $group );
109
+				$this->enqueue_scripts($page->page_hook() ?? $hook, $page, $group);
110 110
 
111 111
 				// Register hook for pre-load page
112
-				$this->pre_load_hook( $page->page_hook() ?? $hook, $page, $group );
112
+				$this->pre_load_hook($page->page_hook() ?? $hook, $page, $group);
113 113
 
114 114
 				break;
115 115
 			default:
116
-				do_action( Hooks::PAGE_REGISTRAR_SUB, $page, $parent_slug );
116
+				do_action(Hooks::PAGE_REGISTRAR_SUB, $page, $parent_slug);
117 117
 		}
118 118
 	}
119 119
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	 * @param \PinkCrab\Perique_Admin_Menu\Group\Abstract_Group|null $group
126 126
 	 * @return void
127 127
 	 */
128
-	protected function enqueue_scripts( string $hook, Page $page, ?Abstract_Group $group = null ): void {
129
-		add_action( 'admin_enqueue_scripts', new Page_Enqueue_Action( $hook, $page, $group ) );
128
+	protected function enqueue_scripts(string $hook, Page $page, ?Abstract_Group $group = null): void {
129
+		add_action('admin_enqueue_scripts', new Page_Enqueue_Action($hook, $page, $group));
130 130
 	}
131 131
 
132 132
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @param \PinkCrab\Perique_Admin_Menu\Group\Abstract_Group|null $group
138 138
 	 * @return void
139 139
 	 */
140
-	protected function pre_load_hook( string $hook, Page $page, ?Abstract_Group $group = null ): void {
141
-		add_action( 'load-' . $hook, new Page_Load_Action( $page, $group ) );
140
+	protected function pre_load_hook(string $hook, Page $page, ?Abstract_Group $group = null): void {
141
+		add_action('load-' . $hook, new Page_Load_Action($page, $group));
142 142
 	}
143 143
 }
Please login to merge, or discard this patch.