for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataExtension;
/**
* @skipUpgrade
*/
class FileExtension extends DataExtension implements TestOnly
{
public function canView($member = null)
$member
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function canView(/** @scrutinizer ignore-unused */ $member = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if ($this->owner->Name === 'disallowCanView.txt') {
return false;
}
public function canEdit($member = null)
if ($this->owner->Name === 'disallowCanEdit.txt') {
public function canDelete($member = null)
if ($this->owner->Name === 'disallowCanDelete.txt') {
public function canArchive($member = null)
return $this->owner->canDelete($member);
public function canCreate($member = null, $context = [])
if (isset($context['Parent']) && $context['Parent']->Name === 'disallowCanAddChildren') {
if (isset($context['Upload']['name']) && $context['Upload']['name'] === 'disallowCanCreate.txt') {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.