GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d09edd...49d6e8 )
by Cyril
11:59 queued 09:17
created

Link   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 72.21%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 27
ccs 13
cts 18
cp 0.7221
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 0 15 1
A formatCell() 0 6 1
1
<?php
2
3
namespace CrossKnowledge\DataTableBundle\DataTable\Table\Element\Column;
4
5
use Symfony\Component\OptionsResolver\Options;
6
use Symfony\Component\OptionsResolver\OptionsResolver;
7
8
class Link extends Column
9
{
10 3
    public function configureOptions(OptionsResolver $resolver)
11
    {
12 3
        parent::configureOptions($resolver);
13 3
        $resolver->setRequired('LinkTextField');
14 3
        $resolver->setDefault('AltTextField', function (Options $options) {
15 3
            return $options['LinkTextField'];
16 3
        });
17 3
        $resolver->setDefault('UrlField', function (Options $options) {
18 1
            return $options['LinkTextField'];
19 3
        });
20 3
        $resolver->setDefault('UrlCallback', function($value, $row) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
21
            return $row[$this->options['UrlField']];
22 3
        });
23 3
        $resolver->setAllowedTypes('UrlCallback', ['\Closure']);
24 3
    }
25
    /**
26
     * Build a link
27
     */
28
    public function formatCell($value, array $rowData, $context)
29
    {
30
        $value = parent::formatCell($value, $rowData);
0 ignored issues
show
Bug introduced by
The call to formatCell() misses a required argument $context.

This check looks for function calls that miss required arguments.

Loading history...
31
        $url = call_user_func_array($this->options['UrlCallback'], [$value, $rowData]);
32
        return '<a href="'.$url.'" alt="'.$rowData[$this->options['LinkTextField']].'">'.$rowData[$this->options['LinkTextField']].'</a>';
33
    }
34
}
35