DownloadColumn::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
rs 9.6666
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Icybee\Modules\Files\Block\ManageBlock;
4
5
use Brickrouge\A;
6
use Icybee\Block\ManageBlock;
7
use Icybee\Modules\Files\File;
8
9
/**
10
 * Representation of the `download` column.
11
 */
12
class DownloadColumn extends ManageBlock\Column
13
{
14
	public function __construct(ManageBlock $manager, $id, array $options=[])
15
	{
16
		parent::__construct($manager, $id, [
17
18
			'orderable' => false,
19
			'title' => null
20
21
		]);
22
	}
23
24
	/**
25
	 * @param File $record
26
	 *
27
	 * @inheritdoc
28
	 */
29
	public function render_cell($record)
30
	{
31
		return new A('', $record->url('download'), [
0 ignored issues
show
Bug introduced by
It seems like $record->url('download') targeting Icybee\Modules\Files\File::url() can also be of type object<ICanBoogie\Routing\FormattedRoute>; however, Brickrouge\A::__construct() does only seem to accept string, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
32
33
			'class' => 'download',
34
			'title' => $this->manager->t('Download file')
35
36
		]);
37
	}
38
}
39