for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* php-gedcom.
*
* php-gedcom is a library for parsing, manipulating, importing and exporting
* GEDCOM 5.5 files in PHP 5.3+.
* @author Kristopher Wilson <[email protected]>
* @copyright Copyright (c) 2010-2013, Kristopher Wilson
* @license MIT
* @link http://github.com/mrkrstphr/php-gedcom
*/
namespace PhpGedcom\Writer;
class Addr
{
* @param \PhpGedcom\Record\Addr $addr
* @param string $format
* @param int $level
* @return string
public static function convert(\PhpGedcom\Record\Addr &$addr, $format = self::GEDCOM55, $level = 1)
PhpGedcom\Writer\Addr::GEDCOM55
$format
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public static function convert(\PhpGedcom\Record\Addr &$addr, /** @scrutinizer ignore-unused */ $format = self::GEDCOM55, $level = 1)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$addrs = explode("\n", $addr->getAddr());
$output = "{$level} ADDR ".$addrs[0]."\n";
array_shift($addrs);
foreach ($addrs as $cont) {
$output .= ($level + 1).' CONT '.$cont."\n";
}
$output .= ($level + 1).' ADR1 '.$addr->adr1."\n".
adr1
PhpGedcom\Record\Addr
($level + 1).' ADR2 '.$addr->getAdr2()."\n".
($level + 1).' CITY '.$addr->getCity()."\n".
($level + 1).' STAE '.$addr->getStae()."\n".
($level + 1).' POST '.$addr->getPost()."\n".
($level + 1).' CTRY '.$addr->getCtry()."\n";
return $output;