JsonRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 6 2
1
<?php
2
3
namespace RichanFongdasen\I18n\Repositories;
4
5
class JsonRepository extends Repository
6
{
7
    /**
8
     * Read the json datasource.
9
     *
10
     * @return array
11
     */
12
    protected function read(): array
13
    {
14
        $content = file_get_contents($this->datasource);
15
16
        return ($content !== false) ? json_decode($content) : [];
17
    }
18
}
19