Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
5 / 5 |
DocumentCount | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
5 / 5 |
__invoke($data) | |
100.00% |
1 / 1 |
2 | |
100.00% |
5 / 5 |
<?php | |
/** | |
* This file is part of the Statistical Classifier package. | |
* | |
* (c) Cam Spiers <camspiers@gmail.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Camspiers\StatisticalClassifier\Transform; | |
/** | |
* @author Cam Spiers <camspiers@gmail.com> | |
* @package Statistical Classifier | |
*/ | |
class DocumentCount | |
{ | |
public function __invoke($data) | |
{ | |
$count = 0; | |
foreach ($data as $docs) { | |
$count += count($docs); | |
} | |
return $count; | |
} | |
} |