@@ -44,82 +44,82 @@ |
||
44 | 44 | { |
45 | 45 | $head = $gedcom->getHead(); |
46 | 46 | $subn = $gedcom->getSubn(); |
47 | - $subms = $gedcom->getSubm(); // array() |
|
48 | - $sours = $gedcom->getSour(); // array() |
|
49 | - $indis = $gedcom->getIndi(); // array() |
|
50 | - $fams = $gedcom->getFam(); // array() |
|
51 | - $notes = $gedcom->getNote(); // array() |
|
52 | - $repos = $gedcom->getRepo(); // array() |
|
53 | - $objes = $gedcom->getObje(); // array() |
|
47 | + $subms = $gedcom->getSubm(); // array() |
|
48 | + $sours = $gedcom->getSour(); // array() |
|
49 | + $indis = $gedcom->getIndi(); // array() |
|
50 | + $fams = $gedcom->getFam(); // array() |
|
51 | + $notes = $gedcom->getNote(); // array() |
|
52 | + $repos = $gedcom->getRepo(); // array() |
|
53 | + $objes = $gedcom->getObje(); // array() |
|
54 | 54 | |
55 | 55 | $output = "0 FORMAT ".$format."\n"; |
56 | 56 | |
57 | 57 | // head |
58 | - if($head){ |
|
58 | + if ($head) { |
|
59 | 59 | $output = Head::convert($head, $format); |
60 | 60 | } |
61 | 61 | |
62 | 62 | // subn |
63 | - if($subn){ |
|
63 | + if ($subn) { |
|
64 | 64 | $output .= Subn::convert($subn); |
65 | 65 | } |
66 | 66 | |
67 | 67 | // subms |
68 | - if(!empty($subms) && count($subms) > 0){ |
|
69 | - foreach($subms as $item){ |
|
70 | - if($item){ |
|
68 | + if (!empty($subms) && count($subms) > 0) { |
|
69 | + foreach ($subms as $item) { |
|
70 | + if ($item) { |
|
71 | 71 | $output .= Subm::convert($item); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | 76 | // sours |
77 | - if(!empty($sours) && count($sours) > 0){ |
|
78 | - foreach($sours as $item){ |
|
79 | - if($item){ |
|
77 | + if (!empty($sours) && count($sours) > 0) { |
|
78 | + foreach ($sours as $item) { |
|
79 | + if ($item) { |
|
80 | 80 | $output .= Sour::convert($item); |
81 | 81 | } |
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
85 | 85 | // indis |
86 | - if(!empty($indis) && count($indis) > 0){ |
|
87 | - foreach($indis as $item){ |
|
88 | - if($item){ |
|
86 | + if (!empty($indis) && count($indis) > 0) { |
|
87 | + foreach ($indis as $item) { |
|
88 | + if ($item) { |
|
89 | 89 | $output .= Indi::convert($item); |
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | 94 | // fams |
95 | - if(!empty($fams) && count($fams) > 0){ |
|
96 | - foreach($fams as $item){ |
|
97 | - if($item){ |
|
95 | + if (!empty($fams) && count($fams) > 0) { |
|
96 | + foreach ($fams as $item) { |
|
97 | + if ($item) { |
|
98 | 98 | $output .= Fam::convert($item); |
99 | 99 | } |
100 | 100 | } |
101 | 101 | } |
102 | 102 | // notes |
103 | - if(!empty($notes) && count($notes) > 0){ |
|
104 | - foreach($notes as $item){ |
|
105 | - if($item){ |
|
103 | + if (!empty($notes) && count($notes) > 0) { |
|
104 | + foreach ($notes as $item) { |
|
105 | + if ($item) { |
|
106 | 106 | $output .= Note::convert($item); |
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | 111 | // repos |
112 | - if(!empty($repos) && count($repos) > 0){ |
|
113 | - foreach($repos as $item){ |
|
114 | - if($item){ |
|
112 | + if (!empty($repos) && count($repos) > 0) { |
|
113 | + foreach ($repos as $item) { |
|
114 | + if ($item) { |
|
115 | 115 | $output .= Repo::convert($item); |
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
119 | 119 | // Objes |
120 | - if(!empty($objes) && count($objes) > 0){ |
|
121 | - foreach($objes as $item){ |
|
122 | - if($item){ |
|
120 | + if (!empty($objes) && count($objes) > 0) { |
|
121 | + foreach ($objes as $item) { |
|
122 | + if ($item) { |
|
123 | 123 | $output .= Obje::convert($item); |
124 | 124 | } |
125 | 125 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | break; |
166 | 166 | case 'CONC': |
167 | 167 | if (isset($record[2])) { |
168 | - $data .= ' ' . trim($record[2]); |
|
168 | + $data .= ' '.trim($record[2]); |
|
169 | 169 | } |
170 | 170 | break; |
171 | 171 | default: |
@@ -221,15 +221,15 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function logUnhandledRecord($additionalInfo = '') { |
223 | 223 | $this->logError( |
224 | - $this->_linesParsed . ': (Unhandled) ' . trim(implode('|', $this->getCurrentLineRecord())) . |
|
225 | - (!empty($additionalInfo) ? ' - ' . $additionalInfo : '') |
|
224 | + $this->_linesParsed.': (Unhandled) '.trim(implode('|', $this->getCurrentLineRecord())). |
|
225 | + (!empty($additionalInfo) ? ' - '.$additionalInfo : '') |
|
226 | 226 | ); |
227 | 227 | } |
228 | 228 | |
229 | 229 | public function logSkippedRecord($additionalInfo = '') { |
230 | 230 | $this->logError( |
231 | - $this->_linesParsed . ': (Skipping) ' . trim(implode('|', $this->getCurrentLineRecord())) . |
|
232 | - (!empty($additionalInfo) ? ' - ' . $additionalInfo : '') |
|
231 | + $this->_linesParsed.': (Skipping) '.trim(implode('|', $this->getCurrentLineRecord())). |
|
232 | + (!empty($additionalInfo) ? ' - '.$additionalInfo : '') |
|
233 | 233 | ); |
234 | 234 | } |
235 | 235 | |
@@ -304,10 +304,10 @@ discard block |
||
304 | 304 | // EOF |
305 | 305 | break; |
306 | 306 | } else { |
307 | - $this->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
307 | + $this->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
308 | 308 | } |
309 | 309 | } else { |
310 | - $this->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
310 | + $this->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | $this->forward(); |