Issues (331)

examples/long-lines.php (3 issues)

Labels
Severity
1
<?php
2
3
use Cairo\Context;
0 ignored issues
show
The type Cairo\Context 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

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\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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
$position = 10.5;
8
$width = 10;
9
$height = 8;
10
11
$surface = new Image(ImageFormat::ARGB32, 70, 70);
12
$context = new Context($surface);
13
14
$line[0] = ['len' => 100.0, 'r' => 1, 'g' => 0, 'b' => 0];
15
$line[1] = ['len' => 10000.0, 'r' => 0, 'g' => 1, 'b' => 0];
16
$line[2] = ['len' => 10000.0, 'r' => 0, 'g' => 0, 'b' => 1];
17
$line[3] = ['len' => 10000.0, 'r' => 1, 'g' => 1, 'b' => 0];
18
$line[4] = ['len' => 10000.0, 'r' => 0, 'g' => 1, 'b' => 1];
19
$line[5] = ['len' => 10000.0, 'r' => 1, 'g' => 0, 'b' => 1];
20
21
$context->save();
22
$context->setSourceRgb(1, 1, 1);
23
$context->paint();
24
$context->restore();
25
$context->save();
26
$context->setLineWidth(1);
27
28
for ($i = 0; $i < 6; $i++)
29
{
30
	$context->moveTo($position, -$line[$i]['len']);
31
	$context->lineTo($position, $line[$i]['len']);
32
	$context->setSourceRgb($line[$i]['r'], $line[$i]['g'], $line[$i]['b']);
33
	$context->stroke();
34
	$position += 10;
35
}
36
37
$context->restore();
38
$context->moveTo(35, -10000);
39
$context->lineTo(35, 10000);
40
$context->setLineWidth(1);
41
$context->stroke();
42
43
$surface->writeToPng(dirname(__FILE__).'/long-lines-php.png');
44