Skip to content

Commit 0b54e61

Browse files
committed
Review
1 parent 7f4a97a commit 0b54e61

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

ext/fileinfo/fileinfo.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
376376
break;
377377

378378
default:
379-
zend_argument_type_error(2, "must be of type string|resource, %s given", zend_zval_type_name(what));
379+
zend_argument_type_error(2, "must be of type resource|string, %s given", zend_zval_type_name(what));
380380
RETURN_THROWS();
381381
}
382382

@@ -482,12 +482,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
482482
}
483483
break;
484484
}
485-
486-
default:
487-
php_error_docref(NULL, E_WARNING, "Can only process string or stream arguments");
488-
// TODO Not sure I understand this code flow completely
489-
//zend_argument_type_error(2, "must be of type string|resource, %s given", zend_zval_type_name(group));
490-
//goto clean;
485+
EMPTY_SWITCH_DEFAULT_CASE()
491486
}
492487

493488
common:

ext/fileinfo/tests/mime_content_type_001.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ try {
4141

4242
?>
4343
--EXPECTF--
44-
mime_content_type(): Argument #2 must be of type string|resource, int given
45-
mime_content_type(): Argument #2 must be of type string|resource, null given
46-
mime_content_type(): Argument #2 must be of type string|resource, stdClass given
47-
mime_content_type(): Argument #2 must be of type string|resource, array given
44+
mime_content_type(): Argument #2 must be of type resource|string, int given
45+
mime_content_type(): Argument #2 must be of type resource|string, null given
46+
mime_content_type(): Argument #2 must be of type resource|string, stdClass given
47+
mime_content_type(): Argument #2 must be of type resource|string, array given
4848

4949
Warning: mime_content_type(foo/inexistent): Failed to open stream: No such file or directory in %s on line %d
5050
mime_content_type(): Argument #1 ($filename) cannot be empty

0 commit comments

Comments
 (0)