Classification::classify()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Artstorm\MonkeyLearn\Api;
4
5
class Classification extends ApiAbstract
6
{
7
    /**
8
     * Perform the classification of many text samples.
9
     *
10
     * @link   http://docs.monkeylearn.com/article/api-reference/#Classify_POST
11
     *
12
     * @param  array  $text
13
     * @param  string $classifierId
14
     *
15
     * @return array
16
     */
17 2
    public function classify(array $text, $classifierId)
18
    {
19 2
        $parameters = ['text_list' => $text];
20
21 2
        return $this->post(
22 2
            sprintf('classifiers/%s/classify/', $classifierId),
23
            $parameters
24 2
        );
25
    }
26
}
27