swen100 /
cairo
| 1 | <?php |
||
| 2 | |||
| 3 | use Cairo\Context; |
||
|
0 ignored issues
–
show
|
|||
| 4 | use Cairo\Surface\Pdf; |
||
|
0 ignored issues
–
show
The type
Cairo\Surface\Pdf 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 Loading history...
|
|||
| 5 | |||
| 6 | function drawPattern($surface, $size) |
||
| 7 | { |
||
| 8 | $context = new Context($surface); |
||
| 9 | $context->setSourceRgb(1, 1, 1); |
||
| 10 | $context->rectangle(0, 0, $size / 2, $size / 2); |
||
| 11 | $context->fill(); |
||
| 12 | $context->setSourceRgb(1, 0, 0); |
||
| 13 | $context->rectangle($size / 2, 0, $size / 2, $size / 2); |
||
| 14 | $context->fill(); |
||
| 15 | $context->setSourceRgb(0, 1, 0); |
||
| 16 | $context->rectangle(0, $size / 2, $size / 2, $size / 2); |
||
| 17 | $context->fill(); |
||
| 18 | $context->setSourceRgb(0, 0, 1); |
||
| 19 | $context->rectangle($size / 2, $size / 2, $size / 2, $size / 2); |
||
| 20 | $context->fill(); |
||
| 21 | } |
||
| 22 | |||
| 23 | $size = 90; |
||
| 24 | $surface = new Pdf('pdf-surface-source.pdf', $size, $size); |
||
| 25 | $surface->setFallbackResolution(72, 72); |
||
| 26 | $context = new Context($surface); |
||
| 27 | $context->setSourceRgb(0, 0, 0); |
||
| 28 | $context->paint(); |
||
| 29 | |||
| 30 | $surfaceSize = $size - 30; |
||
| 31 | $s = new Pdf('temp.pdf', $surfaceSize, $surfaceSize); |
||
| 32 | drawPattern($s, $surfaceSize); |
||
| 33 | $s->writeToPng(dirname(__FILE__).'/temp.png'); |
||
| 34 | $context->setSurface($s, 15.0, 15.0); |
||
| 35 | $context->paint(); |
||
| 36 | |||
| 37 | $surface->writeToPng(dirname(__FILE__).'/pdf-surface-source-php.png'); |
||
| 38 |
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