@@ -55,7 +55,7 @@ |
||
55 | 55 | $parser->forward(); |
56 | 56 | } |
57 | 57 | |
58 | - $date = $chan->getYear() .'-'. $chan->getMonth() .'-'. $chan->getDay(); |
|
58 | + $date = $chan->getYear().'-'.$chan->getMonth().'-'.$chan->getDay(); |
|
59 | 59 | $chan->setDatetime($date); |
60 | 60 | |
61 | 61 | return $chan; |
@@ -50,147 +50,147 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | switch ($recordType) { |
53 | - case '_UID': |
|
54 | - $indi->setUid(trim($record[2])); |
|
55 | - break; |
|
56 | - case 'RESN': |
|
57 | - $indi->setResn(trim($record[2])); |
|
58 | - break; |
|
59 | - case 'NAME': |
|
60 | - $name = \Gedcom\Parser\Indi\Name::parse($parser); |
|
61 | - $indi->addName($name); |
|
62 | - break; |
|
63 | - case 'SEX': |
|
64 | - $indi->setSex(isset($record[2]) ? trim($record[2]) : ''); |
|
65 | - break; |
|
66 | - case 'ADOP': |
|
67 | - case 'BIRT': |
|
68 | - $birt = \Gedcom\Parser\Birt::parse($parser); |
|
69 | - $indi->setBirt($birt); |
|
70 | - break; |
|
71 | - case 'BAPM': |
|
72 | - case 'BARM': |
|
73 | - case 'BASM': |
|
74 | - case 'BLES': |
|
75 | - case 'BURI': |
|
76 | - $buri = \Gedcom\Parser\Buri::parse($parser); |
|
77 | - $indi->setBuri($buri); |
|
78 | - break; |
|
79 | - case 'CENS': |
|
80 | - case 'CHR': |
|
81 | - case 'CHRA': |
|
82 | - case 'CONF': |
|
83 | - case 'CREM': |
|
84 | - case 'DEAT': |
|
85 | - $deat = \Gedcom\Parser\Deat::parse($parser); |
|
86 | - $indi->setDeat($deat); |
|
87 | - break; |
|
88 | - case 'EMIG': |
|
89 | - case 'FCOM': |
|
90 | - case 'GRAD': |
|
91 | - case 'IMMI': |
|
92 | - case 'NATU': |
|
93 | - case 'ORDN': |
|
94 | - case 'RETI': |
|
95 | - case 'PROB': |
|
96 | - case 'WILL': |
|
97 | - case 'EVEN': |
|
98 | - $className = ucfirst(strtolower($recordType)); |
|
99 | - $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
53 | + case '_UID': |
|
54 | + $indi->setUid(trim($record[2])); |
|
55 | + break; |
|
56 | + case 'RESN': |
|
57 | + $indi->setResn(trim($record[2])); |
|
58 | + break; |
|
59 | + case 'NAME': |
|
60 | + $name = \Gedcom\Parser\Indi\Name::parse($parser); |
|
61 | + $indi->addName($name); |
|
62 | + break; |
|
63 | + case 'SEX': |
|
64 | + $indi->setSex(isset($record[2]) ? trim($record[2]) : ''); |
|
65 | + break; |
|
66 | + case 'ADOP': |
|
67 | + case 'BIRT': |
|
68 | + $birt = \Gedcom\Parser\Birt::parse($parser); |
|
69 | + $indi->setBirt($birt); |
|
70 | + break; |
|
71 | + case 'BAPM': |
|
72 | + case 'BARM': |
|
73 | + case 'BASM': |
|
74 | + case 'BLES': |
|
75 | + case 'BURI': |
|
76 | + $buri = \Gedcom\Parser\Buri::parse($parser); |
|
77 | + $indi->setBuri($buri); |
|
78 | + break; |
|
79 | + case 'CENS': |
|
80 | + case 'CHR': |
|
81 | + case 'CHRA': |
|
82 | + case 'CONF': |
|
83 | + case 'CREM': |
|
84 | + case 'DEAT': |
|
85 | + $deat = \Gedcom\Parser\Deat::parse($parser); |
|
86 | + $indi->setDeat($deat); |
|
87 | + break; |
|
88 | + case 'EMIG': |
|
89 | + case 'FCOM': |
|
90 | + case 'GRAD': |
|
91 | + case 'IMMI': |
|
92 | + case 'NATU': |
|
93 | + case 'ORDN': |
|
94 | + case 'RETI': |
|
95 | + case 'PROB': |
|
96 | + case 'WILL': |
|
97 | + case 'EVEN': |
|
98 | + $className = ucfirst(strtolower($recordType)); |
|
99 | + $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
100 | 100 | |
101 | - $event = $class::parse($parser); |
|
102 | - $indi->addEven($event); |
|
103 | - break; |
|
104 | - case 'CAST': |
|
105 | - case 'DSCR': |
|
106 | - case 'EDUC': |
|
107 | - case 'IDNO': |
|
108 | - case 'NATI': |
|
109 | - case 'NCHI': |
|
110 | - case 'NMR': |
|
111 | - case 'OCCU': |
|
112 | - case 'PROP': |
|
113 | - case 'RELI': |
|
114 | - case 'RESI': |
|
115 | - case 'SSN': |
|
116 | - case 'TITL': |
|
117 | - $className = ucfirst(strtolower($recordType)); |
|
118 | - $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
101 | + $event = $class::parse($parser); |
|
102 | + $indi->addEven($event); |
|
103 | + break; |
|
104 | + case 'CAST': |
|
105 | + case 'DSCR': |
|
106 | + case 'EDUC': |
|
107 | + case 'IDNO': |
|
108 | + case 'NATI': |
|
109 | + case 'NCHI': |
|
110 | + case 'NMR': |
|
111 | + case 'OCCU': |
|
112 | + case 'PROP': |
|
113 | + case 'RELI': |
|
114 | + case 'RESI': |
|
115 | + case 'SSN': |
|
116 | + case 'TITL': |
|
117 | + $className = ucfirst(strtolower($recordType)); |
|
118 | + $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
119 | 119 | |
120 | - $att = $class::parse($parser); |
|
121 | - $indi->addAttr($att); |
|
122 | - break; |
|
123 | - case 'BAPL': |
|
124 | - case 'CONL': |
|
125 | - case 'ENDL': |
|
126 | - case 'SLGC': |
|
127 | - $className = ucfirst(strtolower($recordType)); |
|
128 | - $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
120 | + $att = $class::parse($parser); |
|
121 | + $indi->addAttr($att); |
|
122 | + break; |
|
123 | + case 'BAPL': |
|
124 | + case 'CONL': |
|
125 | + case 'ENDL': |
|
126 | + case 'SLGC': |
|
127 | + $className = ucfirst(strtolower($recordType)); |
|
128 | + $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
129 | 129 | |
130 | - $lds = $class::parse($parser); |
|
131 | - $indi->{'add'.$recordType}[] = $lds; |
|
132 | - break; |
|
133 | - case 'FAMC': |
|
134 | - $famc = \Gedcom\Parser\Indi\Famc::parse($parser); |
|
135 | - if ($famc) { |
|
136 | - $indi->addFamc($famc); |
|
137 | - } |
|
138 | - break; |
|
139 | - case 'FAMS': |
|
140 | - $fams = \Gedcom\Parser\Indi\Fams::parse($parser); |
|
141 | - if ($fams) { |
|
142 | - $indi->addFams($fams); |
|
143 | - } |
|
144 | - break; |
|
145 | - case 'SUBM': |
|
146 | - $indi->addSubm($parser->normalizeIdentifier($record[2])); |
|
147 | - break; |
|
148 | - case 'ASSO': |
|
149 | - $asso = \Gedcom\Parser\Indi\Asso::parse($parser); |
|
150 | - $indi->addAsso($asso); |
|
151 | - break; |
|
152 | - case 'ALIA': |
|
153 | - $indi->addAlia($parser->normalizeIdentifier($record[2])); |
|
154 | - break; |
|
155 | - case 'ANCI': |
|
156 | - $indi->addAnci($parser->normalizeIdentifier($record[2])); |
|
157 | - break; |
|
158 | - case 'DESI': |
|
159 | - $indi->addDesi($parser->normalizeIdentifier($record[2])); |
|
160 | - break; |
|
161 | - case 'RFN': |
|
162 | - $indi->setRfn(trim($record[2])); |
|
163 | - break; |
|
164 | - case 'AFN': |
|
165 | - $indi->setAfn(trim($record[2])); |
|
166 | - break; |
|
167 | - case 'REFN': |
|
168 | - $ref = \Gedcom\Parser\Refn::parse($parser); |
|
169 | - $indi->addRefn($ref); |
|
170 | - break; |
|
171 | - case 'RIN': |
|
172 | - $indi->setRin(trim($record[2])); |
|
173 | - break; |
|
174 | - case 'CHAN': |
|
175 | - $chan = \Gedcom\Parser\Chan::parse($parser); |
|
176 | - $indi->setChan($chan); |
|
177 | - break; |
|
178 | - case 'NOTE': |
|
179 | - $note = \Gedcom\Parser\NoteRef::parse($parser); |
|
180 | - if ($note) { |
|
181 | - $indi->addNote($note); |
|
182 | - } |
|
183 | - break; |
|
184 | - case 'SOUR': |
|
185 | - $sour = \Gedcom\Parser\SourRef::parse($parser); |
|
186 | - $indi->addSour($sour); |
|
187 | - break; |
|
188 | - case 'OBJE': |
|
189 | - $obje = \Gedcom\Parser\ObjeRef::parse($parser); |
|
190 | - $indi->addObje($obje); |
|
191 | - break; |
|
192 | - default: |
|
193 | - $parser->logUnhandledRecord(self::class.' @ '.__LINE__); |
|
130 | + $lds = $class::parse($parser); |
|
131 | + $indi->{'add'.$recordType}[] = $lds; |
|
132 | + break; |
|
133 | + case 'FAMC': |
|
134 | + $famc = \Gedcom\Parser\Indi\Famc::parse($parser); |
|
135 | + if ($famc) { |
|
136 | + $indi->addFamc($famc); |
|
137 | + } |
|
138 | + break; |
|
139 | + case 'FAMS': |
|
140 | + $fams = \Gedcom\Parser\Indi\Fams::parse($parser); |
|
141 | + if ($fams) { |
|
142 | + $indi->addFams($fams); |
|
143 | + } |
|
144 | + break; |
|
145 | + case 'SUBM': |
|
146 | + $indi->addSubm($parser->normalizeIdentifier($record[2])); |
|
147 | + break; |
|
148 | + case 'ASSO': |
|
149 | + $asso = \Gedcom\Parser\Indi\Asso::parse($parser); |
|
150 | + $indi->addAsso($asso); |
|
151 | + break; |
|
152 | + case 'ALIA': |
|
153 | + $indi->addAlia($parser->normalizeIdentifier($record[2])); |
|
154 | + break; |
|
155 | + case 'ANCI': |
|
156 | + $indi->addAnci($parser->normalizeIdentifier($record[2])); |
|
157 | + break; |
|
158 | + case 'DESI': |
|
159 | + $indi->addDesi($parser->normalizeIdentifier($record[2])); |
|
160 | + break; |
|
161 | + case 'RFN': |
|
162 | + $indi->setRfn(trim($record[2])); |
|
163 | + break; |
|
164 | + case 'AFN': |
|
165 | + $indi->setAfn(trim($record[2])); |
|
166 | + break; |
|
167 | + case 'REFN': |
|
168 | + $ref = \Gedcom\Parser\Refn::parse($parser); |
|
169 | + $indi->addRefn($ref); |
|
170 | + break; |
|
171 | + case 'RIN': |
|
172 | + $indi->setRin(trim($record[2])); |
|
173 | + break; |
|
174 | + case 'CHAN': |
|
175 | + $chan = \Gedcom\Parser\Chan::parse($parser); |
|
176 | + $indi->setChan($chan); |
|
177 | + break; |
|
178 | + case 'NOTE': |
|
179 | + $note = \Gedcom\Parser\NoteRef::parse($parser); |
|
180 | + if ($note) { |
|
181 | + $indi->addNote($note); |
|
182 | + } |
|
183 | + break; |
|
184 | + case 'SOUR': |
|
185 | + $sour = \Gedcom\Parser\SourRef::parse($parser); |
|
186 | + $indi->addSour($sour); |
|
187 | + break; |
|
188 | + case 'OBJE': |
|
189 | + $obje = \Gedcom\Parser\ObjeRef::parse($parser); |
|
190 | + $indi->addObje($obje); |
|
191 | + break; |
|
192 | + default: |
|
193 | + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | $parser->forward(); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | if ($recordType == 'BURI') { |
49 | - $a=''; |
|
49 | + $a = ''; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | switch ($recordType) { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function setDate($date) { |
42 | 42 | $this->date = $date; |
43 | 43 | if ($this->getDay()) { |
44 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
44 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
45 | 45 | } |
46 | 46 | else { |
47 | 47 | $this->year = $date; |
@@ -42,8 +42,7 @@ |
||
42 | 42 | $this->date = $date; |
43 | 43 | if ($this->getDay()) { |
44 | 44 | $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
45 | - } |
|
46 | - else { |
|
45 | + } else { |
|
47 | 46 | $this->year = $date; |
48 | 47 | $this->date = null; |
49 | 48 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | |
112 | 112 | public function setDatetime($date = '') |
113 | 113 | { |
114 | - $this->datetime = $date .' '. $this->time; |
|
114 | + $this->datetime = $date.' '.$this->time; |
|
115 | 115 | |
116 | 116 | return $this; |
117 | 117 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | public function setDate($date) { |
40 | 40 | $this->date = $date; |
41 | 41 | if ($this->getDay()) { |
42 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
42 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
43 | 43 | } |
44 | 44 | else { |
45 | 45 | $this->dateFormatted = null; |
@@ -40,8 +40,7 @@ |
||
40 | 40 | $this->date = $date; |
41 | 41 | if ($this->getDay()) { |
42 | 42 | $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
43 | - } |
|
44 | - else { |
|
43 | + } else { |
|
45 | 44 | $this->dateFormatted = null; |
46 | 45 | $this->year = $date; |
47 | 46 | $this->date = null; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | public function setDate($date) { |
40 | 40 | $this->date = $date; |
41 | 41 | if ($this->getDay()) { |
42 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
42 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
43 | 43 | } |
44 | 44 | else { |
45 | 45 | $this->year = $date; |
@@ -40,8 +40,7 @@ |
||
40 | 40 | $this->date = $date; |
41 | 41 | if ($this->getDay()) { |
42 | 42 | $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
43 | - } |
|
44 | - else { |
|
43 | + } else { |
|
45 | 44 | $this->year = $date; |
46 | 45 | $this->date = null; |
47 | 46 | } |