Passed
Push — master ( b04009...b8980d )
by Tobias
02:33
created
src/WrkLst/DocxMustache/DocImage.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -40,6 +40,10 @@
 block discarded – undo
40 40
         return false;
41 41
     }
42 42
 
43
+    /**
44
+     * @param DocxMustache $parent
45
+     * @param string $data
46
+     */
43 47
     protected function ResampleImage($parent, $imgs, $k, $data)
44 48
     {
45 49
         \Storage::disk($parent->storageDisk)->put($parent->local_path.'word/media/'.$imgs[$k]['img_file_src'], $data);
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace WrkLst\DocxMustache;
4 4
 
5
-use Exception;
6
-use Illuminate\Support\Facades\Log;
7
-
8 5
 class DocImage
9 6
 {
10 7
     protected function AllowedContentTypeImages()
Please login to merge, or discard this patch.
src/WrkLst/DocxMustache/DocxMustache.php 2 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -101,6 +101,9 @@  discard block
 block discarded – undo
101 101
             ->extractTo($this->storagePath($this->local_path), array($file), \Chumper\Zipper\Zipper::WHITELIST);
102 102
     }
103 103
 
104
+    /**
105
+     * @param string $file
106
+     */
104 107
     protected function ReadOpenXmlFile($file, $type="file")
105 108
     {
106 109
         $this->exctractOpenXmlFile($file);
@@ -126,6 +129,10 @@  discard block
 block discarded – undo
126 129
         }
127 130
     }
128 131
 
132
+    /**
133
+     * @param string $file
134
+     * @param string|false $folder
135
+     */
129 136
     protected function saveOpenXmlFile($file, $folder, $content)
130 137
     {
131 138
         \Storage::disk($this->storageDisk)
@@ -193,6 +200,9 @@  discard block
 block discarded – undo
193 200
         }
194 201
     }
195 202
 
203
+    /**
204
+     * @param \SimpleXMLElement $main_file
205
+     */
196 206
     protected function FetchReplaceableImages(&$main_file, $ns)
197 207
     {
198 208
         //set up basic arrays to keep track of imgs
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
             ->extractTo($this->storagePath($this->local_path), array($file), \Chumper\Zipper\Zipper::WHITELIST);
102 102
     }
103 103
 
104
-    protected function ReadOpenXmlFile($file, $type="file")
104
+    protected function ReadOpenXmlFile($file, $type = "file")
105 105
     {
106 106
         $this->exctractOpenXmlFile($file);
107 107
 
108
-        if($type=="file")
108
+        if ($type == "file")
109 109
         {
110 110
             if ($file_contents = \Storage::disk($this->storageDisk)->get($this->local_path.$file))
111 111
             {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         $this->log('Analyze Template');
141 141
         //get the main document out of the docx archive
142
-        $this->word_doc = ReadOpenXmlFile('word/document.xml','file');
142
+        $this->word_doc = ReadOpenXmlFile('word/document.xml', 'file');
143 143
 
144 144
         $this->log('Merge Data into Template');
145 145
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     protected function AddContentType($imageCt = "jpeg")
159 159
     {
160
-        $ct_file = $this->ReadOpenXmlFile('[Content_Types].xml','object');
160
+        $ct_file = $this->ReadOpenXmlFile('[Content_Types].xml', 'object');
161 161
 
162 162
         if (!($ct_file instanceof \Traversable)) {
163 163
             throw new Exception('Cannot traverse through [Content_Types].xml.');
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         $imgs = $replaceableImage['imgs'];
331 331
         $imgs_replaced = $replaceableImage['imgs_replaced'];
332 332
 
333
-        $rels_file = $this->ReadOpenXmlFile('word/_rels/document.xml.rels','object');
333
+        $rels_file = $this->ReadOpenXmlFile('word/_rels/document.xml.rels', 'object');
334 334
 
335 335
         $this->RemoveReplaceImages($imgs_replaced, $rels_file);
336 336
 
Please login to merge, or discard this patch.
src/WrkLst/DocxMustache/HtmlConversion.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -7,6 +7,9 @@
 block discarded – undo
7 7
 
8 8
 class HtmlConversion
9 9
 {
10
+    /**
11
+     * @param MustacheRender $value
12
+     */
10 13
     public function __construct($value)
11 14
     {
12 15
         return $this->convertHtmlToOpenXML($value);
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace WrkLst\DocxMustache;
4 4
 
5
-use Exception;
6
-use Illuminate\Support\Facades\Log;
7
-
8 5
 class HtmlConversion
9 6
 {
10 7
     public function __construct($value)
Please login to merge, or discard this patch.