Completed
Push — master ( 50f973...73c8b5 )
by MeWebStudio - Muharrem
02:22
created
src/PurifierServiceProvider.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
53 53
      */
54 54
     public function provides()
55 55
     {
56
-        return ['purifier'];
56
+        return [ 'purifier' ];
57 57
     }
58 58
 
59 59
 }
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Purifier.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,8 +89,8 @@  discard block
 block discarded – undo
89 89
         $cachePath = $this->config->get('purifier.cachePath');
90 90
 
91 91
         if ($cachePath) {
92
-            if (!$this->files->isDirectory($cachePath)) {
93
-                $this->files->makeDirectory($cachePath, $this->config->get('purifier.cacheFileMode', 0755) );
92
+            if ( ! $this->files->isDirectory($cachePath)) {
93
+                $this->files->makeDirectory($cachePath, $this->config->get('purifier.cacheFileMode', 0755));
94 94
             }
95 95
         }
96 96
     }
@@ -110,19 +110,19 @@  discard block
 block discarded – undo
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');
116
-        $default_config['Cache.SerializerPermissions'] = $this->config->get('purifier.cacheFileMode', 0755 );
113
+        $default_config = [ ];
114
+        $default_config[ 'Core.Encoding' ]        = $this->config->get('purifier.encoding');
115
+        $default_config[ 'Cache.SerializerPath' ] = $this->config->get('purifier.cachePath');
116
+        $default_config[ 'Cache.SerializerPermissions' ] = $this->config->get('purifier.cacheFileMode', 0755);
117 117
 
118
-        if (!$config) {
118
+        if ( ! $config) {
119 119
             $config = $this->config->get('purifier.settings.default');
120 120
         } elseif (is_string($config)) {
121
-            $config = $this->config->get('purifier.settings.' . $config);
121
+            $config = $this->config->get('purifier.settings.'.$config);
122 122
         }
123 123
 
124
-        if (!is_array($config)) {
125
-            $config = [];
124
+        if ( ! is_array($config)) {
125
+            $config = [ ];
126 126
         }
127 127
 
128 128
         $config = $default_config + $config;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     public function clean($dirty, $config = null)
139 139
     {
140 140
         if (is_array($dirty)) {
141
-            return array_map(function ($item) use ($config) {
141
+            return array_map(function($item) use ($config) {
142 142
                 return $this->clean($item, $config);
143 143
             }, $dirty);
144 144
         } else {
Please login to merge, or discard this patch.