for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SilverStripe\Comments\Admin\CommentsGridFieldBulkAction;
use Colymba\BulkManager\BulkAction\Handler;
use SilverStripe\Comments\Model\Comment;
use SilverStripe\Core\Convert;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
abstract class CommentHandler extends Handler
{
protected $xhr = true;
protected $destructive = false;
/**
* @param HTTPRequest $request
* @return HTTPResponse
*/
public function index(HTTPRequest $request)
$request
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$ids = [];
foreach ($this->getRecords() as $comment) {
array_push($ids, $comment->ID);
$this->updateComment($comment);
}
$response = new HTTPResponse(Convert::raw2json([
'done' => true,
'records' => $ids,
]));
$response->addHeader('Content-Type', 'application/json');
return $response;
* @param Comment $comment
*
* @return Comment
abstract public function updateComment($comment);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.