Completed
Branch master (7d7b3f)
by Ori
01:38
created

DefaultResource   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDataStream() 0 4 1
A getInlineDataStream() 0 4 1
A handlesProfile() 0 4 1
1
<?php
2
3
namespace frictionlessdata\datapackage\Resources;
4
5
use frictionlessdata\datapackage\DataStreams\DefaultDataStream;
6
7
class DefaultResource extends BaseResource
8
{
9
    /**
10
     * @param string $dataSource
11
     *
12
     * @return DefaultDataStream
13
     */
14
    protected function getDataStream($dataSource, $dataSourceOptions = null)
15
    {
16
        return new DefaultDataStream($this->normalizeDataSource($dataSource, $this->basePath), $dataSourceOptions);
17
    }
18
19
    protected function getInlineDataStream($data)
20
    {
21
        return $data;
22
    }
23
24
    protected static function handlesProfile($profile)
25
    {
26
        return $profile == 'data-resource';
27
    }
28
}
29