Completed
Branch master (1f9106)
by Nils
03:23
created

JsFileCountRule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 3
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilesToCount() 0 4 1
1
<?php
2
3
namespace whm\Smoke\Rules\Html;
4
5
use whm\Html\Document;
6
use whm\Smoke\Http\Response;
7
8
/**
9
 * This rules counts the js files that are included in a document. If the number is higher
10
 * than a given value the test failes.
11
 */
12
class JsFileCountRule extends CountRule
13
{
14
    protected $errorMessage = 'Too many javascript files (%u) were found.';
15
16
    protected function getFilesToCount(Document $document, Response $response)
17
    {
18
        return $document->getJsFiles($response->getUri());
19
    }
20
}
21