Issues (331)

examples/clip-nesting.php (3 issues)

Labels
Severity
1
<?php
2
3
use Cairo\Context;
0 ignored issues
show
The type Cairo\Context was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
use Cairo\Surface\Image;
0 ignored issues
show
The type Cairo\Surface\Image was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use Cairo\Surface\ImageFormat;
0 ignored issues
show
The type Cairo\Surface\ImageFormat was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
$size = 100;
8
$border = 10;
9
$linewidth = 20;
10
11
$surface = new Image(ImageFormat::ARGB32, $size, $size);
12
$context = new Context($surface);
13
$s = $context->getGroupSurface();
14
15
$c = new Context($s);
16
$c->moveTo($border, $border);
17
$c->lineTo($border + $linewidth, $border);
18
$c->lineTo($size - $border, $size - $border);
19
$c->lineTo($size - $border - $linewidth, $size - $border);
20
21
$c->clip();
22
$c->setSourceRgb(0, 0, 1);
23
$c->paint();
24
25
$c->setSourceRgb(1, 1, 1);
26
$c->rectangle(($size / 2) - ($linewidth / 2), $border, $linewidth, ($size - 2) * $border);
27
$c->fill();
28
29
$c2 = new Context($surface);
30
$c2->setSourceRgb(1, 1, 1);
31
$c2->rectangle($size - $border - $linewidth, $border, $linewidth, ($size - 2) * $border);
32
$c2->fill();
33
34
$context->setSourceRgb(1, 1, 1);
35
$context->rectangle($border, $border, $linewidth, ($size - 2) * $border);
36
$context->fill();
37
38
$surface->writeToPng(dirname(__FILE__).'/clip-nesting-php.png');
39
40
41
42
43