You are here

function _coder_review_get_reviews_extensions in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_review/coder_review.module \_coder_review_get_reviews_extensions()

Creates a list of required filename extensions the included in default list.

Parameters

array $defaults: An array of default filename extensions.

array $reviews: An array of available coder reviews.

Return value

array An array of file extensions, which are required to perform any of the reviews, but arenot part of the default filename extension list.

See also

coder_review_page_form()

coder_review_test_case.tinc::runTest()

1 call to _coder_review_get_reviews_extensions()
coder_review_page_form in coder_review/coder_review.module
Implements hook_form().

File

coder_review/coder_review.common.inc, line 114
Common functions used by both the drush and form interfaces.

Code

function _coder_review_get_reviews_extensions(array $defaults, array $reviews) {
  $extensions = array();
  foreach ($reviews as $key => $review) {
    foreach ($review['#rules'] as $rule) {
      if (isset($rule['#filename'])) {
        foreach ($rule['#filename'] as $ext) {
          if (!in_array($ext, $defaults) && !in_array($ext, $extensions)) {
            $extensions[] = $ext;
          }
        }
      }
    }
  }
  return $extensions;
}