Completed
Push — master ( 2855be...490a20 )
by Shcherbak
02:34
created

FunivanTokenizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCollection() 0 8 2
1
<?
0 ignored issues
show
Security Best Practice introduced by
It is not recommend to use PHP's short opening tag <?, better use <?php, or <?= in case of outputting.

Short opening tags are disabled in PHP’s default configuration. In such a case, all content of this file is output verbatim to the browser without being parsed, or executed.

As a precaution to avoid these problems better use the long opening tag <?php.

Loading history...
2
3
  namespace Funivan\Cs\Util;
4
5
  use Funivan\Cs\FileFinder\FileInfo;
6
  use Funivan\PhpTokenizer\Collection;
7
8
  /**
9
   *
10
   */
11
  trait FunivanTokenizer {
12
13
    private $collections = [];
14
15
16
    /**
17
     * @param FileInfo $fileInfo
18
     * @return Collection
19
     */
20
    public function getCollection(FileInfo $fileInfo) {
21
      $key = $fileInfo->getPath();
22
      if (!isset($this->collections[$key])) {
23
        $this->collections[$key] = \Funivan\PhpTokenizer\Collection::createFromString($fileInfo->getContent()->get());
24
      }
25
26
      return $this->collections[$key];
27
    }
28
29
  }