File tree 1 file changed +15
-10
lines changed
1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -61,25 +61,30 @@ public function __construct()
61
61
}
62
62
63
63
/**
64
- * Parse PDF file
65
- *
66
- * @param string $filename
67
- *
64
+ * @param $filename
68
65
* @return Document
66
+ * @throws \Exception
69
67
*/
70
68
public function parseFile ($ filename )
71
69
{
72
70
$ content = file_get_contents ($ filename );
73
-
74
- return @$ this ->parseContent ($ content );
71
+ /*
72
+ * 2018/06/20 @doganoo as multiple times a
73
+ * users have complained that the parseFile()
74
+ * method dies silently, it is an better option
75
+ * to remove the error control operator (@) and
76
+ * let the users know that the method throws an exception
77
+ * by adding @throws tag to PHPDoc.
78
+ *
79
+ * See here for an example: https://github.com/smalot/pdfparser/issues/204
80
+ */
81
+ return $ this ->parseContent ($ content );
75
82
}
76
83
77
84
/**
78
- * Parse PDF content
79
- *
80
- * @param string $content
81
- *
85
+ * @param $content
82
86
* @return Document
87
+ * @throws \Exception
83
88
*/
84
89
public function parseContent ($ content )
85
90
{
You can’t perform that action at this time.
0 commit comments