Record   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php namespace Scriptotek\OaiPmh;
2
3
use Danmichaelo\QuiteSimpleXMLElement\QuiteSimpleXMLElement;
4
5
/**
6
 * Single record from a OAI-PMH response
7
 */
8
class Record
9
{
10
11
    /** @var string */
12
    public $identifier;
13
14
    /** @var string Date/timestamp of the record */
15
    public $datestamp;
16
17
    /** @var QuiteSimpleXMLElement */
18
    public $data;
19
20
    /**
21
     * Create a new record
22
     *
23
     * @param QuiteSimpleXMLElement $doc
24
     */
25
    public function __construct(QuiteSimpleXMLElement $doc)
26
    {
27
        $this->identifier = $doc->text('oai:header/oai:identifier');
28
        $this->datestamp = $doc->text('oai:header/oai:datestamp');
29
        $this->data = $doc->first('oai:metadata');
30
    }
31
}
32