You are here

function coder_review_sniffer_reviews in Coder 7.2

Implements hook_reviews().

@todo Should we add a use \Exception intruction at top of this file?

Throws

\Exception

File

coder_review/includes/coder_review_sniffer.inc, line 15
This include file implements coder_review functionality for PHP_CodeSniffer.

Code

function coder_review_sniffer_reviews() {
  $rules[] = array(
    '#type' => 'callback',
    '#value' => '_coder_review_sniffer_callback',
    '#source' => 'all',
  );

  // Load the primary PHP CodeSniffer class.
  try {
    @(include_once 'PHP/CodeSniffer.php');
  } catch (Exception $e) {
    $review['#description'] = ' You must install PHP Code_Sniffer.';
  }
  $review = array(
    '#title' => 'Drupal CodeSniffer',
    '#link' => 'http://pear.php.net/package/PHP_CodeSniffer',
    '#rules' => $rules,
    '#version' => 2,
    '#image' => 'images/sniffer.png',
    '#description' => 'Optional; Checks for PHP Coder_Sniffer rules.',
  );
  return array(
    'sniffer' => $review,
  );
}