ISBN_For_PINP::_setISBN()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 3
cp 0
crap 2
1
<?php
2
	require_once("mod_isbn/ISBN.php");
3
4
5
	class ISBN_For_PINP extends ISBN {
6
7
		function __construct($groups_csv, $isbn, $ver) {
8
			ISBN::ISBN($isbn, $ver);
0 ignored issues
show
Bug introduced by
The method ISBN() does not seem to exist on object<ISBN>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
9
			$this->groups_csv = $groups_csv;
10
		}
11
12
		function _convert($isbnin, $verfrom = ISBN_VERSION_ISBN_10, $verto = ISBN_VERSION_ISBN_13) {
13
			return $this->convert($isbnin, $verfrom, $verto);
14
		}
15
16
		function _getCheckdigit() {
17
			return $this->getCheckdigit();
18
		}
19
20
		function _getEAN() {
21
			return $this->getEAN();
22
		}
23
24
		function _getGroup() {
25
			return $this->getGroup();
26
		}
27
28
		function _getISBN() {
29
			return $this->getISBN();
30
		}
31
32
		function _getISBNDisplayable($format = '') {
33
			return $this->getISBNDisplayable($format);
34
		}
35
36
		function _setISBN($isbn) {
37
			return $this->setISBN($isbn);
38
		}
39
40
		function _getPublisher() {
41
			return $this->getPublisher();
42
		}
43
44
		function _getTitle() {
45
			return $this->getTitle();
46
		}
47
48
		function _isValid() {
49
			return $this->isValid();
50
		}
51
52
		function _validate($isbn, $ver = ISBN_DEFAULT_INPUTVERSION) {
53
			return $this->validate($isbn, $ver);
54
		}
55
56
		function _getVersion() {
57
			return $this->getVersion();
58
		}
59
60
		function _guessVersion($isbn) {
61
			return $this->guessVersion($isbn);
62
		}
63
64
	}
65
66
	class pinp_ISBN  {
67
68
		function _create($isbn = '', $ver = ISBN_DEFAULT_INPUTVERSION) {
69
			$groups_csv = $this->store->get_config("code")."modules/mod_isbn/data/groups.csv";
0 ignored issues
show
Bug introduced by
The property store does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
70
			return new ISBN_For_PINP($groups_csv, $isbn, $ver);
71
		}
72
73
	}
74