@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @throws ApplicationAlreadyBootedException |
38 | 38 | */ |
39 | - public function __construct( $file, array $providers = array() ) { |
|
40 | - if ( null !== static::$instance ) { |
|
39 | + public function __construct($file, array $providers = array()) { |
|
40 | + if (null !== static::$instance) { |
|
41 | 41 | throw new ApplicationAlreadyBootedException; |
42 | 42 | } |
43 | 43 | |
44 | 44 | static::$instance = $this; |
45 | 45 | |
46 | - $this->register_constants( $file ); |
|
46 | + $this->register_constants($file); |
|
47 | 47 | $this->register_core_services(); |
48 | 48 | $this->load_i18n(); |
49 | 49 | |
50 | - register_activation_hook( $file, array( $this, 'activate' ) ); |
|
51 | - register_deactivation_hook( $file, array( $this, 'deactivate' ) ); |
|
50 | + register_activation_hook($file, array($this, 'activate')); |
|
51 | + register_deactivation_hook($file, array($this, 'deactivate')); |
|
52 | 52 | |
53 | - parent::__construct( $providers ); |
|
53 | + parent::__construct($providers); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -59,27 +59,27 @@ discard block |
||
59 | 59 | * @throws UnexpectedValueException |
60 | 60 | */ |
61 | 61 | public function boot() { |
62 | - $loader = $this->fetch( 'loader' ); |
|
62 | + $loader = $this->fetch('loader'); |
|
63 | 63 | |
64 | - if ( ! $loader instanceof LoaderContract ) { |
|
64 | + if (!$loader instanceof LoaderContract) { |
|
65 | 65 | throw new UnexpectedValueException; |
66 | 66 | } |
67 | 67 | |
68 | - foreach ( $this as $alias => $value ) { |
|
69 | - if ( $value instanceof HasActions ) { |
|
70 | - $loader->register_actions( $value ); |
|
68 | + foreach ($this as $alias => $value) { |
|
69 | + if ($value instanceof HasActions) { |
|
70 | + $loader->register_actions($value); |
|
71 | 71 | } |
72 | 72 | |
73 | - if ( $value instanceof HasFilters ) { |
|
74 | - $loader->register_filters( $value ); |
|
73 | + if ($value instanceof HasFilters) { |
|
74 | + $loader->register_filters($value); |
|
75 | 75 | } |
76 | 76 | |
77 | - if ( $value instanceof HasShortcode ) { |
|
78 | - $loader->register_shortcode( $value ); |
|
77 | + if ($value instanceof HasShortcode) { |
|
78 | + $loader->register_shortcode($value); |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - add_action( 'plugins_loaded', array( $loader, 'run' ) ); |
|
82 | + add_action('plugins_loaded', array($loader, 'run')); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @throws ApplicationNotBootedException |
108 | 108 | */ |
109 | 109 | public static function instance() { |
110 | - if ( null === static::$instance ) { |
|
110 | + if (null === static::$instance) { |
|
111 | 111 | throw new ApplicationNotBootedException; |
112 | 112 | } |
113 | 113 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * {@inheritDoc} |
119 | 119 | */ |
120 | 120 | public static function shutdown() { |
121 | - if ( null !== static::$instance ) { |
|
121 | + if (null !== static::$instance) { |
|
122 | 122 | static::$instance = null; |
123 | 123 | } |
124 | 124 | } |
@@ -128,20 +128,20 @@ discard block |
||
128 | 128 | * |
129 | 129 | * @param string $file |
130 | 130 | */ |
131 | - private function register_constants( $file ) { |
|
132 | - $this->share( 'url', plugin_dir_url( $file ) ); |
|
133 | - $this->share( 'path', plugin_dir_path( $file ) ); |
|
134 | - $this->share( 'basename', $basename = plugin_basename( $file ) ); |
|
135 | - $this->share( 'slug', dirname( $basename ) ); |
|
136 | - $this->share( 'version', static::VERSION ); |
|
131 | + private function register_constants($file) { |
|
132 | + $this->share('url', plugin_dir_url($file)); |
|
133 | + $this->share('path', plugin_dir_path($file)); |
|
134 | + $this->share('basename', $basename = plugin_basename($file)); |
|
135 | + $this->share('slug', dirname($basename)); |
|
136 | + $this->share('version', static::VERSION); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
140 | 140 | * Registers the built-in services with the Application container. |
141 | 141 | */ |
142 | 142 | private function register_core_services() { |
143 | - $this->share( array( 'loader' => 'Intraxia\Jaxion\Contract\Core\Loader' ), function ( $app ) { |
|
144 | - return new Loader( $app ); |
|
143 | + $this->share(array('loader' => 'Intraxia\Jaxion\Contract\Core\Loader'), function($app) { |
|
144 | + return new Loader($app); |
|
145 | 145 | } ); |
146 | 146 | } |
147 | 147 | |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | * Load's the plugin's translation files. |
150 | 150 | */ |
151 | 151 | private function load_i18n() { |
152 | - add_action( 'init', function(){ |
|
152 | + add_action('init', function() { |
|
153 | 153 | load_plugin_textdomain( |
154 | - $this->fetch( 'basename' ), |
|
154 | + $this->fetch('basename'), |
|
155 | 155 | false, |
156 | - basename( $this->fetch( 'path' ) ) . '/languages/' |
|
156 | + basename($this->fetch('path')).'/languages/' |
|
157 | 157 | ); |
158 | 158 | }); |
159 | 159 | } |