Skip to content

Bugs found whilst updating example files. #29

@adamdyson

Description

@adamdyson

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions