Figshare   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 1
b 0
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A extractPublicationData() 0 6 2
A extractJournalData() 0 7 2
1
<?php
2
3
namespace PubPeerFoundation\PublicationDataExtractor\Resources\Extractors;
4
5
use PubPeerFoundation\PublicationDataExtractor\Exceptions\JournalTitleNotFoundException;
6
7
class Figshare extends Doi
8
{
9
    /**
10
     * Extract and format data needed for the Journals Relationship
11
     * on the Publication Model.
12
     */
13
    public function extractJournalData(): void
14
    {
15
        try {
16
            parent::extractJournalData();
17
        } catch (JournalTitleNotFoundException $e) {
18
            $this->resourceOutput['journal'] = [
19
                'title' => 'Figshare',
20
            ];
21
        }
22
    }
23
24
    /**
25
     * Extract and format data needed for the Publication Model.
26
     */
27
    public function extractPublicationData(): void
28
    {
29
        parent::extractPublicationData();
30
31
        if (empty($this->resourceOutput['publication']['url'])) {
32
            $this->resourceOutput['publication']['url'] = get_string($this->searchTree, 'id');
33
        }
34
    }
35
}
36