@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | public $gatekeeper; |
19 | 19 | public $id; |
20 | 20 | public $name; |
21 | - public $notices = []; |
|
21 | + public $notices = [ ]; |
|
22 | 22 | public $version; |
23 | 23 | |
24 | 24 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | |
32 | 32 | public function __construct() |
33 | 33 | { |
34 | - $this->file = realpath( dirname( dirname( __FILE__ )) . '/pollux.php' ); |
|
35 | - $this->gatekeeper = new GateKeeper( plugin_basename( $this->file )); |
|
34 | + $this->file = realpath( dirname( dirname( __FILE__ ) ) . '/pollux.php' ); |
|
35 | + $this->gatekeeper = new GateKeeper( plugin_basename( $this->file ) ); |
|
36 | 36 | |
37 | 37 | $data = get_file_data( $this->file, array( |
38 | 38 | 'id' => 'Text Domain', |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $basename = plugin_basename( $this->file ); |
58 | 58 | $controller = $this->make( 'Controller' ); |
59 | 59 | |
60 | - add_action( 'admin_enqueue_scripts', array( $controller, 'registerAssets' )); |
|
61 | - add_action( 'admin_init', array( $controller, 'removeDashboardWidgets' )); |
|
62 | - add_action( 'wp_before_admin_bar_render', array( $controller, 'removeWordPressMenu' )); |
|
63 | - add_filter( "plugin_action_links_{$basename}", array( $controller, 'filterPluginLinks' )); |
|
64 | - add_filter( 'admin_footer_text', array( $controller, 'filterWordPressFooter' )); |
|
60 | + add_action( 'admin_enqueue_scripts', array( $controller, 'registerAssets' ) ); |
|
61 | + add_action( 'admin_init', array( $controller, 'removeDashboardWidgets' ) ); |
|
62 | + add_action( 'wp_before_admin_bar_render', array( $controller, 'removeWordPressMenu' ) ); |
|
63 | + add_filter( "plugin_action_links_{$basename}", array( $controller, 'filterPluginLinks' ) ); |
|
64 | + add_filter( 'admin_footer_text', array( $controller, 'filterWordPressFooter' ) ); |
|
65 | 65 | |
66 | 66 | // Disallow indexing of the site on non-production environments |
67 | 67 | if( !$this->environment( 'production' ) && !is_admin() ) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function environment( $checkFor = '' ) |
77 | 77 | { |
78 | 78 | $environment = defined( 'WP_ENV' ) ? WP_ENV : 'production'; |
79 | - if( !empty( $checkFor )) { |
|
79 | + if( !empty( $checkFor ) ) { |
|
80 | 80 | return $environment == $checkFor; |
81 | 81 | } |
82 | 82 | return $environment; |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | trailingslashit( trailingslashit( $theme->theme_root ) . $theme->template ), |
96 | 96 | trailingslashit( WP_CONTENT_DIR ), |
97 | 97 | trailingslashit( ABSPATH ), |
98 | - trailingslashit( dirname( ABSPATH )), |
|
99 | - trailingslashit( dirname( dirname( ABSPATH ))), |
|
100 | - ]); |
|
98 | + trailingslashit( dirname( ABSPATH ) ), |
|
99 | + trailingslashit( dirname( dirname( ABSPATH ) ) ), |
|
100 | + ] ); |
|
101 | 101 | foreach( (array) $locations as $location ) { |
102 | - if( !file_exists( $location . $filename ))continue; |
|
102 | + if( !file_exists( $location . $filename ) )continue; |
|
103 | 103 | return $location . $filename; |
104 | 104 | } |
105 | 105 | return null; |
@@ -132,14 +132,14 @@ discard block |
||
132 | 132 | * @param string $view |
133 | 133 | * @return bool |
134 | 134 | */ |
135 | - public function render( $view, array $data = [] ) |
|
135 | + public function render( $view, array $data = [ ] ) |
|
136 | 136 | { |
137 | 137 | $file = apply_filters( 'pollux/views/file', |
138 | - $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ))), |
|
138 | + $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ) ) ), |
|
139 | 139 | $view, |
140 | 140 | $data |
141 | 141 | ); |
142 | - if( file_exists( $file )) { |
|
142 | + if( file_exists( $file ) ) { |
|
143 | 143 | extract( $data ); |
144 | 144 | return include $file; |
145 | 145 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function url( $path = '' ) |
154 | 154 | { |
155 | - return esc_url( plugin_dir_url( $this->file ) . ltrim( trim( $path ), '/' )); |
|
155 | + return esc_url( plugin_dir_url( $this->file ) . ltrim( trim( $path ), '/' ) ); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | protected function loadHooks() |
186 | 186 | { |
187 | - if( $file = $this->getFile( 'pollux-hooks.php' )) { |
|
187 | + if( $file = $this->getFile( 'pollux-hooks.php' ) ) { |
|
188 | 188 | include_once $file; |
189 | 189 | } |
190 | 190 | } |
@@ -198,6 +198,6 @@ discard block |
||
198 | 198 | 'ArchiveMeta' => 'GeminiLabs\Pollux\Facades\ArchiveMeta', |
199 | 199 | 'PostMeta' => 'GeminiLabs\Pollux\Facades\PostMeta', |
200 | 200 | 'SiteMeta' => 'GeminiLabs\Pollux\Facades\SiteMeta', |
201 | - )))->register(); |
|
201 | + ) ) )->register(); |
|
202 | 202 | } |
203 | 203 | } |