Completed
Pull Request — master (#45)
by Pierre
20:20
created
src/Purifier.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     private function setUp()
62 62
     {
63
-        if (!$this->config->has('purifier')) {
63
+        if ( ! $this->config->has('purifier')) {
64 64
             throw new Exception('Configuration parameters not loaded!');
65 65
         }
66 66
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $config = HTMLPurifier_Config::createDefault();
71 71
 
72 72
         // Allow configuration to be modified
73
-        if (!$this->config->get('purifier.finalize')) {
73
+        if ( ! $this->config->get('purifier.finalize')) {
74 74
             $config->autoFinalize = false;
75 75
         }
76 76
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $cachePath = $this->config->get('purifier.cachePath');
89 89
 
90 90
         if ($cachePath) {
91
-            if (!$this->files->isDirectory($cachePath)) {
91
+            if ( ! $this->files->isDirectory($cachePath)) {
92 92
                 $this->files->makeDirectory($cachePath, $this->config->get('purifier.cacheFileMode', 0755));
93 93
             }
94 94
         }
@@ -111,19 +111,19 @@  discard block
 block discarded – undo
111 111
      */
112 112
     protected function getConfig($config = null)
113 113
     {
114
-        $default_config = [];
115
-        $default_config['Core.Encoding'] = $this->config->get('purifier.encoding');
116
-        $default_config['Cache.SerializerPath'] = $this->config->get('purifier.cachePath');
117
-        $default_config['Cache.SerializerPermissions'] = $this->config->get('purifier.cacheFileMode', 0755);
114
+        $default_config = [ ];
115
+        $default_config[ 'Core.Encoding' ] = $this->config->get('purifier.encoding');
116
+        $default_config[ 'Cache.SerializerPath' ] = $this->config->get('purifier.cachePath');
117
+        $default_config[ 'Cache.SerializerPermissions' ] = $this->config->get('purifier.cacheFileMode', 0755);
118 118
 
119
-        if (!$config) {
119
+        if ( ! $config) {
120 120
             $config = $this->config->get('purifier.settings.default');
121 121
         } elseif (is_string($config)) {
122 122
             $config = $this->config->get('purifier.settings.'.$config);
123 123
         }
124 124
 
125
-        if (!is_array($config)) {
126
-            $config = [];
125
+        if ( ! is_array($config)) {
126
+            $config = [ ];
127 127
         }
128 128
 
129 129
         $config = $default_config + $config;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     public function clean($dirty, $config = null)
141 141
     {
142 142
         if (is_array($dirty)) {
143
-            return array_map(function ($item) use ($config) {
143
+            return array_map(function($item) use ($config) {
144 144
                 return $this->clean($item, $config);
145 145
             }, $dirty);
146 146
         }
Please login to merge, or discard this patch.
src/PurifierServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $source = realpath(__DIR__.'/../config/purifier.php');
35 35
         if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
36
-            $this->publishes([$source => config_path('purifier.php')]);
36
+            $this->publishes([ $source => config_path('purifier.php') ]);
37 37
         } elseif ($this->app instanceof LumenApplication) {
38 38
             $this->app->configure('purifier');
39 39
         }
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function register()
50 50
     {
51
-        $this->app->singleton('purifier', function (Container $app) {
52
-            return new Purifier($app['files'], $app['config']);
51
+        $this->app->singleton('purifier', function(Container $app) {
52
+            return new Purifier($app[ 'files' ], $app[ 'config' ]);
53 53
         });
54 54
 
55 55
         $this->app->alias('purifier', Purifier::class);
@@ -62,6 +62,6 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function provides()
64 64
     {
65
-        return ['purifier'];
65
+        return [ 'purifier' ];
66 66
     }
67 67
 }
Please login to merge, or discard this patch.