diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 62cf5821..b12aabdf 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -173,7 +173,7 @@ public static function setColor_output($color_output) self::$optionArray['color_output'] = $color_output; } - public static function set_color_output($color_output) + public static function set_color_output() { trigger_error('Use setColor_output()', E_USER_DEPRECATED); } diff --git a/phpdotnet/phd/Format.php b/phpdotnet/phd/Format.php index f59e6a02..d5a217a1 100644 --- a/phpdotnet/phd/Format.php +++ b/phpdotnet/phd/Format.php @@ -312,7 +312,6 @@ public function getFormatName() { /* Buffer where append data instead of the standard stream (see format's appendData()) */ final public function parse($xml) { - $parsed = ""; $reader = new Reader(); $render = new Render(); @@ -468,7 +467,7 @@ public function initRow() { } public function getEntryOffset(array $attrs) { $curr = $this->TABLE["next_colnum"]; - foreach($this->TABLE["colspec"] as $col => $spec) { + foreach($this->TABLE["colspec"] as $spec) { if ($spec["colname"] == $attrs["colname"]) { $colnum = $spec["colnum"]; $this->TABLE["next_colnum"] += $colnum-$curr; @@ -479,7 +478,7 @@ public function getEntryOffset(array $attrs) { } public function colspan(array $attrs) { if (isset($attrs["namest"])) { - foreach($this->TABLE["colspec"] as $colnum => $spec) { + foreach($this->TABLE["colspec"] as $spec) { if ($spec["colname"] == $attrs["namest"]) { $from = $spec["colnum"]; continue; diff --git a/phpdotnet/phd/Format/Abstract/PDF.php b/phpdotnet/phd/Format/Abstract/PDF.php index 40042e15..14f0589c 100644 --- a/phpdotnet/phd/Format/Abstract/PDF.php +++ b/phpdotnet/phd/Format/Abstract/PDF.php @@ -79,7 +79,6 @@ class PdfWriter { const LINE_SPACING = 2; // nb of points between two lines const INDENT_SPACING = 10; // nb of points for indent const DEFAULT_SHIFT = 20; // default value (points) for shifted paragraph - private $SCALE; // nb of points for 1 centimeter private $PAGE_WIDTH; // in points private $PAGE_HEIGHT; // in points @@ -94,7 +93,6 @@ class PdfWriter { private $currentFontColor; private $fonts; private $oldFonts = array(); - private $text; private $vOffset = 0; private $hOffset = 0; @@ -142,9 +140,9 @@ function __construct($pageWidth = 210, $pageHeight = 297, Config $config) { $this->haruDoc->setPagesConfiguration(2); // Page format - $this->SCALE = 72/25.4; - $this->PAGE_WIDTH = $pageWidth * $this->SCALE; - $this->PAGE_HEIGHT = $pageHeight * $this->SCALE; + $scale = 72/25.4; + $this->PAGE_WIDTH = $pageWidth * $scale; + $this->PAGE_HEIGHT = $pageHeight * $scale; // Set fonts $this->fonts["Helvetica"] = $this->haruDoc->getFont("Helvetica", "WinAnsiEncoding"); diff --git a/phpdotnet/phd/Index.php b/phpdotnet/phd/Index.php index 3a82ea9b..620da3c4 100644 --- a/phpdotnet/phd/Index.php +++ b/phpdotnet/phd/Index.php @@ -343,7 +343,7 @@ public function format_chunk($open, $name, $attrs, $props) { return false; } if (array_pop($this->isChunk)) { - $lastchunk = array_pop($this->chunks); + array_pop($this->chunks); $this->currentchunk = end($this->chunks); $this->appendID(); } diff --git a/phpdotnet/phd/MediaManager.php b/phpdotnet/phd/MediaManager.php index 09a73e4c..b22ec2c9 100644 --- a/phpdotnet/phd/MediaManager.php +++ b/phpdotnet/phd/MediaManager.php @@ -127,7 +127,7 @@ public function findFile($filename, $allowfallback = true) ); $foundfile = false; - foreach($sourcefilenames as $pathoffset => $filenameinfo) { + foreach($sourcefilenames as $filenameinfo) { // Look for current language specific file. if (file_exists($testingfile = $this->relative_source_path . $filenameinfo[0] . $filenameinfo[1])) { $foundfile = $testingfile; diff --git a/phpdotnet/phd/Options/Handler.php b/phpdotnet/phd/Options/Handler.php index 11388c40..311fc246 100644 --- a/phpdotnet/phd/Options/Handler.php +++ b/phpdotnet/phd/Options/Handler.php @@ -74,7 +74,7 @@ public function option_f(string $k, mixed $v): array public function option_format(string $k, mixed $v): array { $formats = []; - foreach((array)$v as $i => $val) { + foreach((array)$v as $val) { if (!in_array($val, $formats)) { $formats[] = $val; } @@ -319,7 +319,7 @@ public function option_s(string $k, mixed $v): array public function option_skip(string $k, mixed $v): array { $skip_ids = $this->config->skip_ids(); - foreach((array)$v as $i => $val) { + foreach((array)$v as $val) { $recursive = true; if (strpos($val, "=") !== false) { list($val, $recursive) = explode("=", $val); @@ -370,7 +370,7 @@ public function option_verbose(string $k, mixed $v): array { static $verbose = 0; - foreach((array)$v as $i => $val) { + foreach((array)$v as $val) { foreach(explode("|", $val) as $const) { if (defined($const)) { $verbose |= (int)constant($const); @@ -452,7 +452,7 @@ public function option_color(string $k, mixed $v): array public function option_css(string $k, mixed $v): array { $styles = []; - foreach((array)$v as $key => $val) { + foreach((array)$v as $val) { if (!in_array($val, $styles)) { $styles[] = $val; } @@ -474,7 +474,7 @@ public function option_k(string $k, mixed $v): array public function option_packagedir(string $k, mixed $v): array { $packages = $this->config->package_dirs(); - foreach((array)$v as $key => $val) { + foreach((array)$v as $val) { if ($path = realpath($val)) { if (!in_array($path, $packages)) { $packages[] = $path; diff --git a/phpdotnet/phd/PI/PHPDOCHandler.php b/phpdotnet/phd/PI/PHPDOCHandler.php index 99191520..fa6859b4 100644 --- a/phpdotnet/phd/PI/PHPDOCHandler.php +++ b/phpdotnet/phd/PI/PHPDOCHandler.php @@ -26,7 +26,6 @@ public function parse($target, $data) { case "function": case "refentry": $tmp = $this->format->getRefs(); - $ret = ""; $refs = array(); $info = array(); foreach($tmp as $id) { diff --git a/phpdotnet/phd/Package/Generic/PDF.php b/phpdotnet/phd/Package/Generic/PDF.php index 04af5255..407dfb46 100644 --- a/phpdotnet/phd/Package/Generic/PDF.php +++ b/phpdotnet/phd/Package/Generic/PDF.php @@ -771,7 +771,6 @@ public function format_entry($open, $name, $attrs, $props) { if ($open) { $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); $align = (isset($dbattrs["align"]) ? $dbattrs["align"] : $align); - $retval = ""; if (isset($dbattrs["colname"])) { for($i=Format::getEntryOffset($dbattrs); $i>0; --$i) { $this->pdfDoc->add(PdfWriter::TABLE_ENTRY, array(1, 1, $align)); @@ -995,7 +994,6 @@ public function format_initializer($open, $name, $attrs) { public function format_footnoteref($open, $name, $attrs, $props) { if ($open) { $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; - $found = false; foreach($this->cchunk["footnote"] as $k => $note) { if ($note["id"] === $linkend) { $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0,0,1)); @@ -1031,7 +1029,7 @@ public function format_footnote($open, $name, $attrs, $props) { } public function format_co($open, $name, $attrs, $props) { - if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"]) && $attrs[Reader::XMLNS_XML]["id"]) { $co = ++$this->cchunk["co"]; $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0,0,1)); if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkends"]) && $linkends = $attrs[Reader::XMLNS_DOCBOOK]["linkends"]) { diff --git a/phpdotnet/phd/Package/Generic/TocFeed.php b/phpdotnet/phd/Package/Generic/TocFeed.php index f6a85f48..a7ca9eb2 100644 --- a/phpdotnet/phd/Package/Generic/TocFeed.php +++ b/phpdotnet/phd/Package/Generic/TocFeed.php @@ -357,7 +357,7 @@ protected function createAtomToc($id) $toc = ''; $date = $this->date; - foreach ($chunks as $junk => $chunkid) { + foreach ($chunks as $chunkid) { $long = $this->getLongDescription($chunkid); $short = $this->getShortDescription($chunkid); $id = $this->idprefix . $chunkid; diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index 59beca28..067c775e 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -676,7 +676,6 @@ public function format_suppressed_text($value, $tag) { } public function format_link($open, $name, $attrs, $props) { - $link = null; if ($open) { $link = $class = $content = ""; @@ -855,7 +854,6 @@ public function format_container_chunk_below($open, $name, $attrs, $props) { } $toc = '