Completed
Pull Request — master (#17)
by Steve
07:07
created

FileBlockUsedOnTableExtension::updateUsage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
namespace SilverStripe\ElementalFileBlock\Extension;
4
5
use SilverStripe\ElementalFileBlock\Block\FileBlock;
6
use SilverStripe\ORM\ArrayList;
7
use SilverStripe\ORM\DataExtension;
8
use SilverStripe\ORM\DataObject;
9
10
class FileBlockUsedOnTableExtension extends DataExtension
11
{
12
    /**
13
     * Hides FileBlocks's from the "Used On" tab when viewing files
14
     *
15
     * @return void
16
     * @var ArrayList $dataObjects
17
     * @var DataObject $record
18
     * @see UsedOnTable::updateUsage
19
     */
20
    public function updateUsage(ArrayList &$dataObjects, DataObject &$record)
0 ignored issues
show
Unused Code introduced by
The parameter $record 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

20
    public function updateUsage(ArrayList &$dataObjects, /** @scrutinizer ignore-unused */ DataObject &$record)

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...
21
    {
22
        $dataObjects = $dataObjects->exclude('ClassName', FileBlock::class);
23
    }
24
}
25