@@ -31,7 +31,8 @@ |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | private function __clone() |
| 34 | - {} |
|
| 34 | + { |
|
| 35 | +} |
|
| 35 | 36 | |
| 36 | 37 | /** |
| 37 | 38 | * Get or create the singleton alias loader instance. |
@@ -16,18 +16,18 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | protected static $instance; |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * The container's bound services. |
|
| 21 | - * |
|
| 22 | - * @var array |
|
| 23 | - */ |
|
| 19 | + /** |
|
| 20 | + * The container's bound services. |
|
| 21 | + * |
|
| 22 | + * @var array |
|
| 23 | + */ |
|
| 24 | 24 | protected $services = []; |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * The container's bucket items |
|
| 28 | - * |
|
| 29 | - * @var array |
|
| 30 | - */ |
|
| 26 | + /** |
|
| 27 | + * The container's bucket items |
|
| 28 | + * |
|
| 29 | + * @var array |
|
| 30 | + */ |
|
| 31 | 31 | protected $bucket = []; |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - * Register a Provider. |
|
| 127 | - * |
|
| 128 | - * @return void |
|
| 129 | - */ |
|
| 126 | + * Register a Provider. |
|
| 127 | + * |
|
| 128 | + * @return void |
|
| 129 | + */ |
|
| 130 | 130 | public function register( $provider ) |
| 131 | 131 | { |
| 132 | 132 | $provider->register( $this ); |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function get( $metaKey, array $args = [] ) |
| 14 | 14 | { |
| 15 | - if( empty( $metaKey ))return; |
|
| 15 | + if( empty( $metaKey )) { |
|
| 16 | + return; |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | $args = $this->normalize( $args ); |
| 18 | 20 | $metaKey = $this->buildMetaKey( $metaKey, $args['prefix'] ); |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if( !function_exists( 'pollux_app' )) { |
| 4 | - function pollux_app() { |
|
| 4 | + function pollux_app() |
|
| 5 | + { |
|
| 5 | 6 | return GeminiLabs\Pollux\Application::getInstance(); |
| 6 | 7 | } |
| 7 | 8 | } |
@@ -37,7 +37,9 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function init() |
| 39 | 39 | { |
| 40 | - if( $this->app->config->disable_config )return; |
|
| 40 | + if( $this->app->config->disable_config ) { |
|
| 41 | + return; |
|
| 42 | + } |
|
| 41 | 43 | |
| 42 | 44 | add_action( 'admin_menu', [$this, 'registerPage'] ); |
| 43 | 45 | add_action( 'admin_menu', [$this, 'registerSetting'] ); |
@@ -107,7 +109,9 @@ discard block |
||
| 107 | 109 | { |
| 108 | 110 | if( filter_input( INPUT_GET, 'page' ) !== $this->app->id |
| 109 | 111 | || filter_input( INPUT_GET, 'action' ) !== 'reset' |
| 110 | - )return; |
|
| 112 | + ) { |
|
| 113 | + return; |
|
| 114 | + } |
|
| 111 | 115 | if( wp_verify_nonce( filter_input( INPUT_GET, '_wpnonce' ), static::id() )) { |
| 112 | 116 | delete_option( static::id() ); |
| 113 | 117 | $this->app->make( ConfigManager::class )->compile( true ); |
@@ -40,7 +40,9 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function filterWordPressFooter( $text ) |
| 42 | 42 | { |
| 43 | - if( $this->app->config->remove_wordpress_footer )return; |
|
| 43 | + if( $this->app->config->remove_wordpress_footer ) { |
|
| 44 | + return; |
|
| 45 | + } |
|
| 44 | 46 | return $text; |
| 45 | 47 | } |
| 46 | 48 | |
@@ -79,7 +81,9 @@ discard block |
||
| 79 | 81 | */ |
| 80 | 82 | public function removeDashboardWidgets() |
| 81 | 83 | { |
| 82 | - if( !$this->app->config->remove_dashboard_widgets )return; |
|
| 84 | + if( !$this->app->config->remove_dashboard_widgets ) { |
|
| 85 | + return; |
|
| 86 | + } |
|
| 83 | 87 | $widgets = apply_filters( 'pollux/dashoard/widgets', [ |
| 84 | 88 | 'dashboard_primary', |
| 85 | 89 | 'dashboard_quick_press', |
@@ -95,7 +99,9 @@ discard block |
||
| 95 | 99 | */ |
| 96 | 100 | public function removeWordPressMenu() |
| 97 | 101 | { |
| 98 | - if( !$this->app->config->remove_wordpress_menu )return; |
|
| 102 | + if( !$this->app->config->remove_wordpress_menu ) { |
|
| 103 | + return; |
|
| 104 | + } |
|
| 99 | 105 | global $wp_admin_bar; |
| 100 | 106 | $wp_admin_bar->remove_menu( 'wp-logo' ); |
| 101 | 107 | } |
@@ -122,7 +128,9 @@ discard block |
||
| 122 | 128 | */ |
| 123 | 129 | protected function registerCodemirrorAssets( WP_Screen $screen ) |
| 124 | 130 | { |
| 125 | - if( $screen->id != 'settings_page_pollux' || $screen->pagenow != 'options-general.php' )return; |
|
| 131 | + if( $screen->id != 'settings_page_pollux' || $screen->pagenow != 'options-general.php' ) { |
|
| 132 | + return; |
|
| 133 | + } |
|
| 126 | 134 | wp_enqueue_style( 'pollux/codemirror.css', |
| 127 | 135 | $this->app->url( 'assets/codemirror.css' ), |
| 128 | 136 | [], |
@@ -77,7 +77,9 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function deactivate( $plugin ) |
| 79 | 79 | { |
| 80 | - if( $this->isValid() )return; |
|
| 80 | + if( $this->isValid() ) { |
|
| 81 | + return; |
|
| 82 | + } |
|
| 81 | 83 | $pluginSlug = plugin_basename( $this->file ); |
| 82 | 84 | if( $plugin == $pluginSlug ) { |
| 83 | 85 | $this->redirect(); //exit |
@@ -62,7 +62,9 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | protected function initInstructions() |
| 64 | 64 | { |
| 65 | - if( !$this->showInstructions() )return; |
|
| 65 | + if( !$this->showInstructions() ) { |
|
| 66 | + return; |
|
| 67 | + } |
|
| 66 | 68 | return [ |
| 67 | 69 | 'infodiv' => [ |
| 68 | 70 | 'context' => 'side', |
@@ -147,7 +147,9 @@ |
||
| 147 | 147 | protected function buildMessage( array $messages ) |
| 148 | 148 | { |
| 149 | 149 | foreach( $messages as $key => &$message ) { |
| 150 | - if( !is_wp_error( $message ))continue; |
|
| 150 | + if( !is_wp_error( $message )) { |
|
| 151 | + continue; |
|
| 152 | + } |
|
| 151 | 153 | $message = $message->get_error_message(); |
| 152 | 154 | } |
| 153 | 155 | return wpautop( implode( PHP_EOL . PHP_EOL, $messages )); |