swen100 /
cairo
| 1 | <?php |
||
| 2 | |||
| 3 | use Cairo\Context; |
||
|
0 ignored issues
–
show
|
|||
| 4 | use Cairo\LineCap; |
||
|
0 ignored issues
–
show
The type
Cairo\LineCap 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 | use Cairo\LineJoin; |
||
|
0 ignored issues
–
show
The type
Cairo\LineJoin 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...
|
|||
| 6 | 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 Loading history...
|
|||
| 7 | 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 Loading history...
|
|||
| 8 | |||
| 9 | $linewidth = 10.0; |
||
| 10 | $size = 5 * $linewidth; |
||
| 11 | $pad = 2 * $linewidth; |
||
| 12 | $width = 3 * ($pad + $size) + $pad; |
||
| 13 | $height = $pad + $size + $pad; |
||
| 14 | |||
| 15 | $surface = new Image(ImageFormat::ARGB32, $width, $height); |
||
| 16 | $context = new Context($surface); |
||
| 17 | $context->save(); |
||
| 18 | $context->setSourceRgb(1, 1, 1); |
||
| 19 | $context->paint(); |
||
| 20 | $context->restore(); |
||
| 21 | |||
| 22 | $context->setLineWidth($linewidth); |
||
| 23 | $context->translate($pad, $pad); |
||
| 24 | |||
| 25 | $context->moveTo(0, 0); |
||
| 26 | $context->relLineTo(0, $size); |
||
| 27 | $context->relLineTo($size, 0); |
||
| 28 | $context->closePath(); |
||
| 29 | |||
| 30 | $context->moveTo(2 * $linewidth, 0); |
||
| 31 | $context->relLineTo(3 * $linewidth, 0); |
||
| 32 | $context->relLineTo(0, 3 * $linewidth); |
||
| 33 | |||
| 34 | $context->setLineCap(LineCap::BUTT); |
||
| 35 | $context->setLineJoin(LineJoin::BEVEL); |
||
| 36 | $context->stroke(); |
||
| 37 | |||
| 38 | $context->translate($size + $pad, 0); |
||
| 39 | |||
| 40 | $context->moveTo(0, 0); |
||
| 41 | $context->relLineTo(0, $size); |
||
| 42 | $context->relLineTo($size, 0); |
||
| 43 | $context->closePath(); |
||
| 44 | |||
| 45 | $context->moveTo(2 * $linewidth, 0); |
||
| 46 | $context->relLineTo(3 * $linewidth, 0); |
||
| 47 | $context->relLineTo(0, 3 * $linewidth); |
||
| 48 | |||
| 49 | $context->setLineCap(LineCap::ROUND); |
||
| 50 | $context->setLineJoin(LineJoin::ROUND); |
||
| 51 | $context->stroke(); |
||
| 52 | |||
| 53 | $context->translate($size + $pad, 0); |
||
| 54 | |||
| 55 | $context->moveTo(0, 0); |
||
| 56 | $context->relLineTo(0, $size); |
||
| 57 | $context->relLineTo($size, 0); |
||
| 58 | $context->closePath(); |
||
| 59 | |||
| 60 | $context->moveTo(2 * $linewidth, 0); |
||
| 61 | $context->relLineTo(3 * $linewidth, 0); |
||
| 62 | $context->relLineTo(0, 3 * $linewidth); |
||
| 63 | |||
| 64 | $context->setLineCap(LineCap::SQUARE); |
||
| 65 | $context->setLineJoin(LineJoin::MITER); |
||
| 66 | $context->stroke(); |
||
| 67 | $surface->writeToPng(dirname(__FILE__).'/caps-joins-php.png'); |
||
| 68 | |||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 |
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