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 | |||
| 13 | $surface = new Image(ImageFormat::ARGB32, 3 * ($pad + $size) + $pad, 3 * $pad + 2 * $size); |
||
| 14 | $context = new Context($surface); |
||
| 15 | |||
| 16 | $dash = [$linewidth, 1.5 * $linewidth]; |
||
| 17 | $dashoff = -2 * $linewidth; |
||
| 18 | |||
| 19 | $context->save(); |
||
| 20 | $context->setSourceRgb(1, 1, 1); |
||
| 21 | $context->paint(); |
||
| 22 | $context->restore(); |
||
| 23 | |||
| 24 | for ($i = 0; $i < 2; $i++) |
||
| 25 | { |
||
| 26 | $context->save(); |
||
| 27 | $context->setLineWidth($linewidth); |
||
| 28 | $context->setDash($dash, $dashoff); |
||
| 29 | $context->translate($pad, $pad); |
||
| 30 | |||
| 31 | $context->moveTo(0, 0); |
||
| 32 | $context->relLineTo(0, $size); |
||
| 33 | $context->relLineTo($size, 0); |
||
| 34 | $context->closePath(); |
||
| 35 | $context->moveTo(2 * $linewidth, 0); |
||
| 36 | $context->relLineTo(3 * $linewidth, 0); |
||
| 37 | $context->relLineTo(0, 3 * $linewidth); |
||
| 38 | |||
| 39 | $context->setLineCap(LineCap::BUTT); |
||
| 40 | $context->setLineJoin(LineJoin::BEVEL); |
||
| 41 | $context->stroke(); |
||
| 42 | |||
| 43 | $context->translate($size + $pad, 0); |
||
| 44 | |||
| 45 | $context->moveTo(0, 0); |
||
| 46 | $context->relLineTo(0, $size); |
||
| 47 | $context->relLineTo($size, 0); |
||
| 48 | $context->closePath(); |
||
| 49 | $context->moveTo(2 * $linewidth, 0); |
||
| 50 | $context->relLineTo(3 * $linewidth, 0); |
||
| 51 | $context->relLineTo(0, 3 * $linewidth); |
||
| 52 | |||
| 53 | $context->setLineCap(LineCap::ROUND); |
||
| 54 | $context->setLineJoin(LineJoin::ROUND); |
||
| 55 | $context->stroke(); |
||
| 56 | $context->translate($size + $pad, 0); |
||
| 57 | |||
| 58 | $context->moveTo(0, 0); |
||
| 59 | $context->relLineTo(0, $size); |
||
| 60 | $context->relLineTo($size, 0); |
||
| 61 | $context->closePath(); |
||
| 62 | $context->moveTo(2 * $linewidth, 0); |
||
| 63 | $context->relLineTo(3 * $linewidth, 0); |
||
| 64 | $context->relLineTo(0, 3 * $linewidth); |
||
| 65 | |||
| 66 | $context->setLineCap(LineCap::SQUARE); |
||
| 67 | $context->setLineJoin(LineJoin::MITER); |
||
| 68 | $context->stroke(); |
||
| 69 | $context->restore(); |
||
| 70 | $context->translate(0, $size + $pad); |
||
| 71 | $dashoff = 0; |
||
| 72 | } |
||
| 73 | |||
| 74 | $surface->writeToPng(dirname(__FILE__).'/dash-caps-joins-php.png'); |
||
| 75 |
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