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 | $size = 10; |
||
8 | $pad = 2; |
||
9 | $surface = new Image(ImageFormat::ARGB32, $size, $size); |
||
10 | $context = new Context($surface); |
||
11 | |||
12 | $context->setSourceRgb(0, 0, 1); |
||
13 | $context->rectangle($pad, $pad, $size - 2 * $pad, $size - 2 * $pad); |
||
14 | $context->fill(); |
||
15 | |||
16 | $s = $context->getGroupSurface(); |
||
17 | $c = $s->getContent(); |
||
18 | $s1 = $s->createSimilar($c, $size / 2, $size / 2); |
||
19 | |||
20 | $c = new Context($s1); |
||
21 | $c->setSourceRgb(1, 0, 0); |
||
22 | $c->rectangle($pad, $pad, $size - 2 * $pad, $size - 2 * $pad); |
||
23 | $c->fill(); |
||
24 | |||
25 | $s1->setDeviceOffset($size / 2, $size / 2); |
||
26 | $context->setSurface($s1, $size / 2, $size / 2); |
||
27 | $context->paint(); |
||
28 | |||
29 | $surface->writeToPng(dirname(__FILE__).'/device-offset-positive-php.png'); |
||
30 | |||
31 | |||
32 |
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