Skip to content

Commit 19aec89

Browse files
committed
I don't think this argument should be optional
1 parent bf34489 commit 19aec89

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ PHP_METHOD(CairoContext, __construct)
193193
cairo_context_object *context_object;
194194
cairo_surface_object *surface_object;
195195

196-
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "|o", &surface_zval) == FAILURE) {
196+
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "o", &surface_zval) == FAILURE) {
197197
return;
198198
}
199199

tests/CairoContext/__construct.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if(!extension_loaded('cairo')) die('skip - Cairo extension not available');
66
?>
77
--FILE--
88
<?php
9-
$surface = new Cairo\Surface\Image(CAIRO_FORMAT_ARGB32, 50, 50);
9+
$surface = new Cairo\Surface\Image(Cairo\Surface\ImageFormat::ARGB32, 50, 50);
1010
var_dump($surface);
1111

1212
$context = new Cairo\Context($surface);
@@ -43,4 +43,4 @@ object(Cairo\Context)#%d (0) {
4343
}
4444
Cairo\Context::__construct() expects exactly 1 parameter, 0 given
4545
Cairo\Context::__construct() expects exactly 1 parameter, 2 given
46-
Cairo\Context::__construct() expects parameter 1 to be Cairo\Surface, integer given
46+
Argument 1 passed to Cairo\Context::__construct() must be an instance of Cairo\Surface, int given

0 commit comments

Comments
 (0)