Skip to content

Commit e80917b

Browse files
Merge pull request #35 from familytree365/prefix-issue-fix
some issues fix
2 parents 8adece7 + f0490bf commit e80917b

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

Diff for: src/Parser/Indi/Even.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function parse(\Gedcom\Parser $parser)
2727
}
2828

2929
if (strtoupper(trim($record[1])) != 'EVEN') {
30-
$className = 'GedcomRecordIndi'.ucfirst(strtolower(trim($record[1])));
30+
$className = '\Gedcom\Record\Indi\\'.ucfirst(strtolower(trim($record[1])));
3131
$even = new $className();
3232
} else {
3333
$even = new \Gedcom\Record\Indi\Even();

Diff for: src/Record.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public function __call($method, $args)
2222
$arr = strtolower(substr($method, 3));
2323

2424
if (!property_exists($this, '_'.$arr) || !is_array($this->{'_'.$arr})) {
25-
throw new \Gedcom\Exception('Unknown '.$this::class.'::'.$arr);
25+
throw new \Exception('Unknown '.$this::class.'::'.$arr);
2626
}
2727

2828
if (!is_array($args)) {
29-
throw new \Gedcom\Exception('Incorrect arguments to '.$method);
29+
throw new \Exception('Incorrect arguments to '.$method);
3030
}
3131

3232
if (!isset($args[0])) {
@@ -45,11 +45,11 @@ public function __call($method, $args)
4545
$arr = strtolower(substr($method, 3));
4646

4747
if (!property_exists($this, '_'.$arr)) {
48-
throw new \Gedcom\Exception('Unknown '.$this::class.'::'.$arr);
48+
throw new \Exception('Unknown '.$this::class.'::'.$arr);
4949
}
5050

5151
if (!is_array($args)) {
52-
throw new \Gedcom\Exception('Incorrect arguments to '.$method);
52+
throw new \Exception('Incorrect arguments to '.$method);
5353
}
5454

5555
if (!isset($args[0])) {
@@ -70,7 +70,7 @@ public function __call($method, $args)
7070
// hotfix getData
7171
if ('data' == $arr) {
7272
if (!property_exists($this, '_text')) {
73-
throw new \Gedcom\Exception('Unknown '.$this::class.'::'.$arr);
73+
throw new \Exception('Unknown '.$this::class.'::'.$arr);
7474
}
7575

7676
return $this->{'_text'};
@@ -82,14 +82,14 @@ public function __call($method, $args)
8282

8383
return $this->{'_'.$arr};
8484
} else {
85-
throw new \Gedcom\Exception('Unknown method called: '.$method);
85+
throw new \Exception('Unknown method called: '.$method);
8686
}
8787
}
8888

8989
public function __set($var, $val)
9090
{
9191
// this class does not have any public vars
92-
throw new \Gedcom\Exception('Undefined property '.self::class.'::'.$var);
92+
throw new \Exception('Undefined property '.self::class.'::'.$var);
9393
}
9494

9595
/**

Diff for: src/Record/Plac/Map.php

+25
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,29 @@ class Map extends \Gedcom\Record
2828
* @var string place_longitude
2929
*/
3030
protected $long;
31+
32+
/**
33+
* @param string $lati
34+
*
35+
* @return Map
36+
*/
37+
public function setLati($lati = '')
38+
{
39+
$this->lati = $lati;
40+
41+
return $this;
42+
}
43+
44+
/**
45+
* @param string $long
46+
*
47+
* @return Map
48+
*/
49+
public function setLong($long = '')
50+
{
51+
$this->long = $long;
52+
53+
return $this;
54+
}
55+
3156
}

0 commit comments

Comments
 (0)