Skip to content

Commit 2e9f35b

Browse files
authored
Merge pull request #205 from doganoo/master
removing error control operator and updated PHPDoc
2 parents 665069a + 4f69433 commit 2e9f35b

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/Smalot/PdfParser/Parser.php

+15-10
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,30 @@ public function __construct()
6161
}
6262

6363
/**
64-
* Parse PDF file
65-
*
66-
* @param string $filename
67-
*
64+
* @param $filename
6865
* @return Document
66+
* @throws \Exception
6967
*/
7068
public function parseFile($filename)
7169
{
7270
$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);
7582
}
7683

7784
/**
78-
* Parse PDF content
79-
*
80-
* @param string $content
81-
*
85+
* @param $content
8286
* @return Document
87+
* @throws \Exception
8388
*/
8489
public function parseContent($content)
8590
{

0 commit comments

Comments
 (0)