1 | <?php |
||
2 | |||
3 | use Cairo\Context; |
||
0 ignored issues
–
show
|
|||
4 | 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 ![]() |
|||
5 | 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 ![]() |
|||
6 | 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 ![]() |
|||
7 | |||
8 | $surface = new Image(ImageFormat::RGB24, 165, 30); |
||
9 | $context = new Context($surface); |
||
10 | $context->moveTo(0, 0); |
||
11 | |||
12 | $context->setSourceRgb(1, 1, 1); |
||
13 | $context->paint(); |
||
14 | |||
15 | $context->setSourceRgb(0, 0, 0); |
||
16 | $context->moveTo(0, 0); |
||
17 | $context->translate(5, 5); |
||
18 | |||
19 | /* First compress the pen to a vertical line. */ |
||
20 | $context->rectangle(0, 0, 20, 20); |
||
21 | $context->curveTo(20 / 2, 0, 20, 20 / 2, 20, 20); |
||
22 | $context->save(); |
||
23 | |||
24 | $context->scale(0.00001, 1.0); |
||
25 | $context->stroke(); |
||
26 | |||
27 | $context->restore(); |
||
28 | $context->translate(5 + 20, 0); |
||
29 | |||
30 | /* Then compress the pen to a horizontal line. */ |
||
31 | $context->rectangle(0, 0, 20, 20); |
||
32 | $context->curveTo(20 / 2, 0, 20, 20 / 2, 20, 20); |
||
33 | $context->save(); |
||
34 | |||
35 | $context->scale(1.0, 0.00001); |
||
36 | $context->stroke(); |
||
37 | |||
38 | $context->restore(); |
||
39 | |||
40 | $context->translate(5 + 20, 0); |
||
41 | |||
42 | /* Finally a line at an angle. */ |
||
43 | $context->rectangle(0, 0, 20, 20); |
||
44 | $context->curveTo(20 / 2, 0, 20, 20 / 2, 20, 20); |
||
45 | $context->save(); |
||
46 | |||
47 | $context->rotate(M_PI / 4.0); |
||
48 | $context->scale(0.00001, 1.0); |
||
49 | $context->stroke(); |
||
50 | |||
51 | $context->restore(); |
||
52 | $context->setSourceRgb(1, 1, 1); |
||
53 | $context->paint(); |
||
54 | |||
55 | $context->setSourceRgb(0, 0, 0); |
||
56 | $context->setLineJoin(LineJoin::ROUND); |
||
57 | |||
58 | $context->translate(5, 5); |
||
59 | |||
60 | /* First compress the pen to a vertical line. */ |
||
61 | $context->rectangle(0, 0, 20, 20); |
||
62 | $context->curveTo(20 / 2, 0, 20, 20 / 2, 20, 20); |
||
63 | $context->save(); |
||
64 | |||
65 | $context->scale(0.00001, 1.0); |
||
66 | $context->stroke(); |
||
67 | |||
68 | $context->restore(); |
||
69 | |||
70 | $context->translate(5 + 20, 0); |
||
71 | |||
72 | /* Then compress the pen to a horizontal line. */ |
||
73 | $context->rectangle(0, 0, 20, 20); |
||
74 | $context->curveTo(20 / 2, 0, 20, 20 / 2, 20, 20); |
||
75 | $context->save(); |
||
76 | |||
77 | $context->scale(1.0, 0.00001); |
||
78 | $context->stroke(); |
||
79 | |||
80 | $context->restore(); |
||
81 | |||
82 | $context->translate(5 + 20, 0); |
||
83 | |||
84 | /* Finally a line at an angle. */ |
||
85 | $context->rectangle(0, 0, 20, 20); |
||
86 | $context->curveTo(20 / 2, 0, 20, 20 / 2, 20, 20); |
||
87 | $context->save(); |
||
88 | |||
89 | $context->rotate(M_PI / 4.0); |
||
90 | $context->scale(0.00001, 1.0); |
||
91 | $context->stroke(); |
||
92 | |||
93 | $context->restore(); |
||
94 | $surface->writeToPng(dirname(__FILE__).'/degenerate-pen-php.png'); |
||
95 | |||
96 |
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