Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs found whilst updating example files. #29

Open
adamdyson opened this issue Jun 17, 2017 · 3 comments
Open

Bugs found whilst updating example files. #29

adamdyson opened this issue Jun 17, 2017 · 3 comments

Comments

@adamdyson
Copy link

adamdyson commented Jun 17, 2017

Below are a list of errors encountered whilst re-factoring the example files to work with PHP 7.

Note: I'll continually edit and update this issue until all examples are tested and committed.

a1-image-sample.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Antialias

a1-traps-sample.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Antialias

bitmap-font.php

Uncaught TypeError: Value 2 provided is not a const in enum Cairo\HintMetrics

caps-joins.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\LineCap

caps-sub-paths.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineCap

clip-fill-rule.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\FillRule

clip-operator.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\Operator

composite-integer-translate-over.php

Uncaught TypeError: Value 2 provided is not a const in enum Cairo\Operator

composite-integer-translate-over-repeat.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Extend

composite-integer-translate-source.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Operator

dash-caps-joins.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\LineCap

dash-curve.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineCap

dash-scale.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\LineCap

degenerate-arc.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineCap

degenerate-path.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineCap

degenerate-pen.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineJoin

device-offset.php

Uncaught TypeError: Cairo\Surface::createSimilar() expects parameter 1 to be integer, object given
$s = $context->getGroupSurface();
$c = $s->getContent();
$s1 = $s->createSimilar($c, $size / 2, $size / 2);

device-offset-positive.php

Uncaught TypeError: Cairo\Surface::createSimilar() expects parameter 1 to be integer, object given
$s = $context->getGroupSurface();
$c = $s->getContent();
$s1 = $s->createSimilar($c, $size / 2, $size / 2);

extend-pad.php

Uncaught TypeError: Value 3 provided is not a const in enum Cairo\Extend

extend-reflect.php

Uncaught TypeError: Value 2 provided is not a const in enum Cairo\Extend

extend-repeat.php

Uncaught TypeError: Value 2 provided is not a const in enum Cairo\Extend

extend-repeat-similar.php

Uncaught TypeError: Cairo\Surface::createSimilar() expects parameter 1 to be integer, object given
$s = new Image(ImageFormat::ARGB32, 100, 100);
$s->createFromPng(dirname(__FILE__).'/romedalen.png');
$s1 = $surface->createSimilar($surface->getContent(), 320, 256);

fill-rule.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\FillRule

finer-grained-fallbacks.php

Uncaught TypeError: Value 2 provided is not a const in enum Cairo\Operator

group-paint.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Operator

infinite-join.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineJoin

large-source.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s->createForData($data, ImageFormat::A1, $width, $height, $stride);

linear-gradient-reflect.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\LineJoin

mask-ctm.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s = new Image(ImageFormat::ARGB32, 1, 1);
$s->createForData($data, ImageFormat::ARGB32, 2, 2, 8);

mask-surface-ctm.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s = new Image(ImageFormat::ARGB32, 1, 1);
$s->createForData($data, ImageFormat::ARGB32, 2, 2, 8);

meta-surface-pattern.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\Extend

move-to-show.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s->createForData($c[$i], ImageFormat::RGB24, 1, 1, 4);

nil-surface.php

Uncaught TypeError: Argument 1 passed to Cairo\Pattern\Surface::__construct() must be an instance of Cairo\Surface, null given
$patternSurface = new PatternSurface(null);

operator-clear.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\Operator

operator-source.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Operator

over-above-source.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Operator

over-between-source.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Operator

paint-source-alpha.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s->createForData($data, ImageFormat::ARGB32, 4, 4, 16);

pdf-surface-source.php

Segmentation fault (core dumped)

ps-surface-source.php

Segmentation fault (core dumped)

random-intersections.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\FillRule

rectangle-rounding-error.php

Uncaught TypeError: Value 1 provided is not a const in enum Cairo\Antialias

rectilinear-stroke.php

Uncaught TypeError: Value 2 provided is not a const in enum Cairo\LineCap

rotate-image-surface-paint.php

Uncaught TypeError: Value 3 provided is not a const in enum Cairo\Filter

scale-down-source-surface-paint.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s = new Image(ImageFormat::ARGB32, 100, 100);
$s->createForData($data, ImageFormat::RGB24, 4, 4, 16);

scale-source-surface-paint.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s = new Image(ImageFormat::ARGB32, 100, 100);
$s->createForData($data, ImageFormat::RGB24, 4, 4, 16);

set-source.php

Uncaught ArgumentCountError: Cairo\Surface\Image::createForData() expects exactly 4 parameters, 5 given
$s = new Image(ImageFormat::ARGB32, 1, 1);
$s->createForData($color, ImageFormat::ARGB32, 1, 1, 4);

sphere.php

Uncaught TypeError: Value 0 provided is not a const in enum Cairo\Antialias

surface-check.php

Uncaught Error: Call to undefined function cairo_available_surfaces()
@adamdyson
Copy link
Author

See pull request #30

@auroraeosrose
Copy link
Member

Some of these look like items that are not completely ported to enums yet... the last one should be in Cairo\available_surfaces but it might have been missed in the big port

@adamdyson
Copy link
Author

@auroraeosrose Apologies for not aggregating the errors, allot of them will be duplicates. Sing out if there's anything else I can do to help get things moving towards a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants