FileExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPinterestLink() 0 7 1
1
<?php
2
3
namespace Sunnysideup\ShareThisSimple\Model;
4
5
use SilverStripe\Assets\File;
6
use SilverStripe\Core\Extension;
7
use Sunnysideup\ShareThisSimple\Api\ShareThisSimpleProvider;
8
9
/**
10
 * Class \Sunnysideup\ShareThisSimple\Model\ShareThisSimpleExtension
11
 *
12
 * @property FileExtension $owner
13
 */
14
class FileExtension extends Extension
15
{
16
17
    public function getPinterestLink(?string $imageMethod = '', ?bool $useImageTitle = false): string
0 ignored issues
show
Unused Code introduced by
The parameter $useImageTitle is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    public function getPinterestLink(?string $imageMethod = '', /** @scrutinizer ignore-unused */ ?bool $useImageTitle = false): string

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $imageMethod is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    public function getPinterestLink(/** @scrutinizer ignore-unused */ ?string $imageMethod = '', ?bool $useImageTitle = false): string

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        $owner = $this->getOwner();
20
21
        return 'https://pinterest.com/pin/create/button/?url=' . ($owner->AbsoluteLink()) . '&amp;'
22
            . 'description=' . rawurlencode($owner->Title) . '&amp;'
23
            . 'media=' . rawurlencode($owner->AbsoluteLink());
24
    }
25
}
26