Completed
Push — master ( 30833b...8e8ccf )
by Hamish
11s
created

AssetAdminFile::updateCMSEditLink()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace SilverStripe\AssetAdmin\Controller;
4
5
/**
6
 * Update File dataobjects to be editable in this asset admin
7
 */
8
class AssetAdminFile extends \DataExtension
9
{
10
    public function updateCMSEditLink(&$link) {
11
        // Update edit link for this file to point to the new asset admin
12
        $controller = AssetAdmin::singleton();
13
        $link = \Director::absoluteURL($controller->getFileEditLink($this->owner));
0 ignored issues
show
Compatibility introduced by
$this->owner of type object<DataObject> is not a sub-type of object<File>. It seems like you assume a child class of the class DataObject to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
14
    }
15
}
16