genealogiawebsite /
php-gedcom
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * php-gedcom. |
||||
| 4 | * |
||||
| 5 | * php-gedcom is a library for parsing, manipulating, importing and exporting |
||||
| 6 | * GEDCOM 5.5 files in PHP 5.3+. |
||||
| 7 | * |
||||
| 8 | * @author Kristopher Wilson <[email protected]> |
||||
| 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson |
||||
| 10 | * @license MIT |
||||
| 11 | * |
||||
| 12 | * @link http://github.com/mrkrstphr/php-gedcom |
||||
| 13 | */ |
||||
| 14 | |||||
| 15 | namespace PhpGedcom\Writer; |
||||
| 16 | |||||
| 17 | class Addr |
||||
| 18 | { |
||||
| 19 | /** |
||||
| 20 | * @param \PhpGedcom\Record\Addr $addr |
||||
| 21 | * @param string $format |
||||
| 22 | * @param int $level |
||||
| 23 | * |
||||
| 24 | * @return string |
||||
| 25 | */ |
||||
| 26 | public static function convert(\PhpGedcom\Record\Addr &$addr, $format = self::GEDCOM55, $level = 1) |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
The parameter
$format is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 27 | { |
||||
| 28 | $addrs = explode("\n", $addr->getAddr()); |
||||
| 29 | |||||
| 30 | $output = "{$level} ADDR ".$addrs[0]."\n"; |
||||
| 31 | |||||
| 32 | array_shift($addrs); |
||||
| 33 | |||||
| 34 | foreach ($addrs as $cont) { |
||||
| 35 | $output .= ($level + 1).' CONT '.$cont."\n"; |
||||
| 36 | } |
||||
| 37 | |||||
| 38 | $output .= ($level + 1).' ADR1 '.$addr->adr1."\n". |
||||
|
0 ignored issues
–
show
|
|||||
| 39 | ($level + 1).' ADR2 '.$addr->getAdr2()."\n". |
||||
| 40 | ($level + 1).' CITY '.$addr->getCity()."\n". |
||||
| 41 | ($level + 1).' STAE '.$addr->getStae()."\n". |
||||
| 42 | ($level + 1).' POST '.$addr->getPost()."\n". |
||||
| 43 | ($level + 1).' CTRY '.$addr->getCtry()."\n"; |
||||
| 44 | |||||
| 45 | return $output; |
||||
| 46 | } |
||||
| 47 | } |
||||
| 48 |