@@ -48,8 +48,7 @@ public function __construct() {
48
48
* Can the current PHPWord_Reader_IReader read the file?
49
49
*
50
50
* @param string $pFilename
51
- * @return boolean
52
- * @throws PHPWord_Exception
51
+ * @return bool
53
52
*/
54
53
public function canRead ($ pFilename )
55
54
{
@@ -117,6 +116,7 @@ public function getFromZipArchive($archive, $fileName = '')
117
116
* Loads PHPWord from file
118
117
*
119
118
* @param string $pFilename
119
+ * @return PHPWord
120
120
*/
121
121
public function load ($ pFilename )
122
122
{
@@ -189,7 +189,8 @@ public function load($pFilename)
189
189
$ archive = "$ dir/_rels/ " . basename ($ rel ["Target " ]) . ".rels " ;
190
190
$ relsDoc = simplexml_load_string ($ this ->getFromZipArchive ($ zip , $ archive ));
191
191
$ relsDoc ->registerXPathNamespace ("rel " , "http://schemas.openxmlformats.org/package/2006//relationships " );
192
- $ xpath = self ::array_item ($ relsDoc ->xpath ("rel:Relationship[@Type=' " . "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles'] " ));
192
+ $ xpath = self ::array_item ($ relsDoc ->xpath ("rel:Relationship[@Type=' " .
193
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles'] " ));
193
194
$ xmlDoc = simplexml_load_string ($ this ->getFromZipArchive ($ zip , "{$ rel ['Target ' ]}" ));
194
195
if ($ xmlDoc ->body ) {
195
196
$ section = $ word ->createSection ();
@@ -219,12 +220,18 @@ public function load($pFilename)
219
220
break ;
220
221
}
221
222
}
222
-
223
223
$ zip ->close ();
224
224
225
225
return $ word ;
226
226
}
227
227
228
+ /**
229
+ * Get array item
230
+ *
231
+ * @param array $array
232
+ * @param mixed $key
233
+ * @return mixed|null
234
+ */
228
235
private static function array_item ($ array , $ key = 0 ) {
229
236
return (isset ($ array [$ key ]) ? $ array [$ key ] : null );
230
237
}
0 commit comments