for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yajra\DataTables\Html\Editor\Fields;
/**
* @see https://editor.datatables.net/reference/field/upload
* @see https://editor.datatables.net/examples/advanced/upload.html
* @see https://editor.datatables.net/examples/advanced/upload-many.html
*/
class File extends Field
{
protected $type = 'upload';
* Editor instance.
*
* @var string
protected $editor = 'editor';
* @param string $name
* @param string $label
* @return \Yajra\DataTables\Html\Editor\Fields\Field|static
public static function make($name, $label = '')
return parent::make($name, $label)->displayFile()->clearText()->noImageText();
}
* Set editor instance for file upload.
* @param string $editor
* @return $this
public function editor($editor)
$this->editor = $editor;
return $this;
* Display image upon upload.
public function displayImage()
return $this->display("function (file_id) { return file_id ? '<img src=\"' + {$this->editor}.file('files', file_id).url + '\"/>' : null; }");
$label
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
public function display($value)
$this->attributes['display'] = $value;
* Display the file path.
public function displayFile()
return $this->display("function (file_id) { return file_id; }");
* @param string $value
public function clearText($value = 'Clear')
$this->attributes['clearText'] = $value;
public function noImageText($value = 'No image')
$this->attributes['noImageText'] = $value;
* @param bool $state
public function multiple($state = true)
if ($state) {
$this->type('uploadMany');
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.