Completed
Push — develop ( 95bfc8...365a9b )
by Arkadiusz
02:42
created

WordTokenizer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A tokenize() 0 7 1
1
<?php
2
3
declare (strict_types = 1);
4
5
namespace Phpml\Tokenization;
6
7
class WordTokenizer implements Tokenizer
8
{
9
    /**
10
     * @param string $text
11
     *
12
     * @return array
13
     */
14
    public function tokenize(string $text): array
15
    {
16
        $tokens = [];
17
        preg_match_all('/\w\w+/u', $text, $tokens);
18
19
        return $tokens[0];
20
    }
21
}
22