for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dyanmic\Salsify\ORM;
use SilverStripe\Core\Extension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\ReadonlyField;
/**
* Class AssetFormFactoryExtension
* @package Dyanmic\Salsify\ORM
*
* @property-read \SilverStripe\AssetAdmin\Forms\FileFormFactory $owner
*/
class AssetFormFactoryExtension extends Extension
{
* @param \SilverStripe\Forms\FieldList $fields
public function updateFormFields(FieldList $fields, $controller, $formName, $context)
$controller
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function updateFormFields(FieldList $fields, /** @scrutinizer ignore-unused */ $controller, $formName, $context)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$formName
public function updateFormFields(FieldList $fields, $controller, /** @scrutinizer ignore-unused */ $formName, $context)
$record = isset($context['Record']) ? $context['Record'] : null;
if ($record && $record->SalisfyID) {
$fields->insertAfter('LastEdited', ReadonlyField::create('SalisfyID', 'Salsify ID'));
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.