@@ -49,7 +49,7 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * Get the services provided by the provider. |
| 51 | 51 | * |
| 52 | - * @return array |
|
| 52 | + * @return string[] |
|
| 53 | 53 | */ |
| 54 | 54 | public function provides() |
| 55 | 55 | { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | if ($this->app instanceof LaravelApplication) { |
| 25 | 25 | $this->publishes([ |
| 26 | - __DIR__ . '/../config/purifier.php' => config_path('purifier.php') |
|
| 26 | + __DIR__.'/../config/purifier.php' => config_path('purifier.php') |
|
| 27 | 27 | ]); |
| 28 | 28 | } elseif ($this->app instanceof LumenApplication) { |
| 29 | 29 | $this->app->configure('purifier'); |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | public function register() |
| 39 | 39 | { |
| 40 | 40 | $this->mergeConfigFrom( |
| 41 | - __DIR__ . '/../config/purifier.php', 'mews.purifier' |
|
| 41 | + __DIR__.'/../config/purifier.php', 'mews.purifier' |
|
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | - $this->app->bind('purifier', function ($app) { |
|
| 45 | - return new Purifier($app['files'], $app['config']); |
|
| 44 | + $this->app->bind('purifier', function($app) { |
|
| 45 | + return new Purifier($app[ 'files' ], $app[ 'config' ]); |
|
| 46 | 46 | }); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function provides() |
| 55 | 55 | { |
| 56 | - return ['purifier']; |
|
| 56 | + return [ 'purifier' ]; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | } |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | private function setUp() |
| 60 | 60 | { |
| 61 | - if (!$this->config->has('purifier')) { |
|
| 62 | - if (!$this->config->has('mews.purifier')) { |
|
| 61 | + if ( ! $this->config->has('purifier')) { |
|
| 62 | + if ( ! $this->config->has('mews.purifier')) { |
|
| 63 | 63 | throw new Exception('Configuration parameters not loaded!'); |
| 64 | 64 | } |
| 65 | 65 | $this->config->set('purifier', $this->config->get('mews.purifier')); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $config = HTMLPurifier_Config::createDefault(); |
| 72 | 72 | |
| 73 | 73 | // Allow configuration to be modified |
| 74 | - if (!$this->config->get('purifier.finalize')) { |
|
| 74 | + if ( ! $this->config->get('purifier.finalize')) { |
|
| 75 | 75 | $config->autoFinalize = false; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $cachePath = $this->config->get('purifier.cachePath'); |
| 90 | 90 | |
| 91 | 91 | if ($cachePath) { |
| 92 | - if (!$this->files->isDirectory($cachePath)) { |
|
| 92 | + if ( ! $this->files->isDirectory($cachePath)) { |
|
| 93 | 93 | $this->files->makeDirectory($cachePath); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -110,18 +110,18 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function getConfig($config = null) |
| 112 | 112 | { |
| 113 | - $default_config = []; |
|
| 114 | - $default_config['Core.Encoding'] = $this->config->get('purifier.encoding'); |
|
| 115 | - $default_config['Cache.SerializerPath'] = $this->config->get('purifier.cachePath'); |
|
| 113 | + $default_config = [ ]; |
|
| 114 | + $default_config[ 'Core.Encoding' ] = $this->config->get('purifier.encoding'); |
|
| 115 | + $default_config[ 'Cache.SerializerPath' ] = $this->config->get('purifier.cachePath'); |
|
| 116 | 116 | |
| 117 | - if (!$config) { |
|
| 117 | + if ( ! $config) { |
|
| 118 | 118 | $config = $this->config->get('purifier.settings.default'); |
| 119 | 119 | } elseif (is_string($config)) { |
| 120 | - $config = $this->config->get('purifier.settings.' . $config); |
|
| 120 | + $config = $this->config->get('purifier.settings.'.$config); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (!is_array($config)) { |
|
| 124 | - $config = []; |
|
| 123 | + if ( ! is_array($config)) { |
|
| 124 | + $config = [ ]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $config = $default_config + $config; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function clean($dirty, $config = null) |
| 138 | 138 | { |
| 139 | 139 | if (is_array($dirty)) { |
| 140 | - return array_map(function ($item) use ($config) { |
|
| 140 | + return array_map(function($item) use ($config) { |
|
| 141 | 141 | return $this->clean($item, $config); |
| 142 | 142 | }, $dirty); |
| 143 | 143 | } else { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!function_exists('clean')) { |
|
| 3 | +if ( ! function_exists('clean')) { |
|
| 4 | 4 | |
| 5 | 5 | function clean($dirty, $config = null) |
| 6 | 6 | { |