Fix and improve reflection

- use "p" for path (security check for nul byte)
- fix number of args for some methods
- add type hinting
- throw standard exception (simplify)
- fix test suite for PHP 7.0 to 8.0
This commit is contained in:
Remi Collet
2020-06-22 16:22:37 +02:00
parent d36a2de544
commit cf0ce5a01e
14 changed files with 48 additions and 50 deletions

View File

@@ -6,7 +6,7 @@ Testing FaceLandmarkDetection constructor without arguments
<?php
try {
new FaceLandmarkDetection();
} catch (Exception $e) {
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
@@ -16,6 +16,5 @@ try {
}
?>
--EXPECTF--
Warning: FaceLandmarkDetection::__construct() expects exactly 1 parameter, 0 given in %s on line 3
string(41) "Unable to parse shape_predictor_file_path"
string(73) "FaceLandmarkDetection::__construct() expects exactly 1 parameter, 0 given"
string(45) "Unable to open non-existent file for reading."