1 | <?php |
||
2 | |||
3 | use Cairo\Context; |
||
0 ignored issues
–
show
|
|||
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
6 | |||
7 | $width = 64; |
||
8 | $height = 64; |
||
9 | |||
10 | $surface = new Image(ImageFormat::ARGB32, $width, $height); |
||
11 | $context = new Context($surface); |
||
12 | $context->newPath(); |
||
13 | $context->arc($width / 2, $height / 2, $width / 3, 0, 2 * M_PI); |
||
14 | $context->clip(); |
||
15 | $context->newPath(); |
||
16 | $context->moveTo(0, 0); |
||
17 | $context->lineTo($width / 4, $height / 2); |
||
18 | $context->lineTo(0, $height); |
||
19 | $context->lineTo($width, $height); |
||
20 | $context->lineTo(3 * $width / 4, $height / 2); |
||
21 | $context->lineTo($width, 0); |
||
22 | $context->closePath(); |
||
23 | $context->clip(); |
||
24 | $context->setSourceRgb(0, 0, 0.6); |
||
25 | $context->newPath(); |
||
26 | $context->moveTo(0, 0); |
||
27 | $context->lineTo(0, $height); |
||
28 | $context->lineTo($width / 2, 3 * $height / 4); |
||
29 | $context->lineTo($width, $height); |
||
30 | $context->lineTo($width, 0); |
||
31 | $context->lineTo($width / 2, $height / 4); |
||
32 | $context->closePath(); |
||
33 | $context->fill(); |
||
34 | $context->newPath(); |
||
35 | $context->arc($width / 2, $height / 2, $width / 5, 0, 2 * M_PI); |
||
36 | $context->clip(); |
||
37 | $context->setSourceRgb(1, 1, 0); |
||
38 | $context->paint(); |
||
39 | |||
40 | |||
41 | $surface->writeToPng(dirname(__FILE__).'/clip-twice-php.png'); |
||
42 | |||
43 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths