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 = '
    '; - $desc = ""; if (!in_array($id, $this->TOC_WRITTEN ?? [])) { $toc = $this->createTOC($id, $name, $props); } @@ -1419,7 +1417,6 @@ public function format_fieldsynopsis_varname($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) { return '[' .($k + 1). ']'; diff --git a/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php b/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php index 49393226..c9fd2136 100755 --- a/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php @@ -100,7 +100,6 @@ public function update($event, $val = null) { */ public function header($id) { $title = $this->getShortDescription($id); - $lang = $this->config->language(); static $cssLinks = null; if ($cssLinks === null) { $cssLinks = $this->createCSSLinks(); diff --git a/phpdotnet/phd/Package/PEAR/Web.php b/phpdotnet/phd/Package/PEAR/Web.php index 7f885f8b..e8508891 100755 --- a/phpdotnet/phd/Package/PEAR/Web.php +++ b/phpdotnet/phd/Package/PEAR/Web.php @@ -124,7 +124,6 @@ public function header($id) public function footer($id) { $ext = $this->ext; - $parent = Format::getParent($id); return 'getFilename($id) . $ext . '", ' diff --git a/phpdotnet/phd/Package/PHP/ChunkedXHTML.php b/phpdotnet/phd/Package/PHP/ChunkedXHTML.php index d331fb01..5fecfea7 100644 --- a/phpdotnet/phd/Package/PHP/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/PHP/ChunkedXHTML.php @@ -2,8 +2,6 @@ namespace phpdotnet\phd; class Package_PHP_ChunkedXHTML extends Package_PHP_Web { - private $nav = ""; - public function __construct(Config $config) { parent::__construct($config); $this->registerFormatName("PHP-Chunked-XHTML"); @@ -30,7 +28,6 @@ public function header($id) { HEADER; - $next = $prev = $up = array("href" => null, "desc" => null); $nextLink = $prevLink = $upLink = ''; if ($prevId = Format::getPrevious($id)) { $prev = array( diff --git a/phpdotnet/phd/Package/PHP/HowTo.php b/phpdotnet/phd/Package/PHP/HowTo.php index b7f9082d..36051b42 100644 --- a/phpdotnet/phd/Package/PHP/HowTo.php +++ b/phpdotnet/phd/Package/PHP/HowTo.php @@ -40,7 +40,6 @@ public function header($id) { $parent = Format::getParent($id); $next = $prev = $up = array(null, null); if ($parent && $parent != "ROOT") { - $siblings = Format::getChildren($parent); if ($nextId = Format::getNext($id)) { $next = array( Format::getFilename($nextId) . $this->getExt(), diff --git a/phpdotnet/phd/Package/PHP/KDevelop.php b/phpdotnet/phd/Package/PHP/KDevelop.php index 8541102b..13e766de 100644 --- a/phpdotnet/phd/Package/PHP/KDevelop.php +++ b/phpdotnet/phd/Package/PHP/KDevelop.php @@ -139,7 +139,6 @@ public function format_tocsect1($open, $name, $attrs) { public function format_tocsect2($open, $name, $attrs) { if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; $id = $attrs[Reader::XMLNS_XML]["id"]; - $hasChild = (count(Format::getChildren($id)) > 0); if ($open) { $name = htmlspecialchars(Format::getShortDescription($id), ENT_QUOTES, 'UTF-8'); $url = (Format::getFilename($id) ? Format::getFilename($id) : $id) . $this->getExt(); diff --git a/phpdotnet/phd/Package/PHP/Manpage.php b/phpdotnet/phd/Package/PHP/Manpage.php index a69e89b1..929e0ec2 100644 --- a/phpdotnet/phd/Package/PHP/Manpage.php +++ b/phpdotnet/phd/Package/PHP/Manpage.php @@ -73,7 +73,7 @@ public function header($index) { public function format_chunk($open, $name, $attrs, $props) { return parent::format_chunk($open, $name, $attrs, $props); } - public function format_class_title_text($value, $tag) { + public function format_class_title_text($value) { $this->cchunk["funcname"][] = $this->toValidName(trim($value)); } diff --git a/phpdotnet/phd/Package/PHP/PDF.php b/phpdotnet/phd/Package/PHP/PDF.php index f80ae792..8a528286 100644 --- a/phpdotnet/phd/Package/PHP/PDF.php +++ b/phpdotnet/phd/Package/PHP/PDF.php @@ -79,8 +79,6 @@ class Package_PHP_PDF extends Package_Generic_PDF { ); - private $acronyms = array(); - /* Common properties for all functions pages */ protected $bookName = ""; @@ -253,10 +251,9 @@ protected function resolveLinks($name) { } } - public function format_type_text($type, $tagname) { + public function format_type_text($type) { $type = trim(preg_replace('/[ \n\t]+/', ' ', $type)); $t = strtolower($type); - $href = $fragment = ""; switch($t) { case "bool": @@ -284,7 +281,6 @@ public function format_type_text($type, $tagname) { break; case "mixed": $href = "language.types.declarations"; - $fragment = "language.types.declarations.$t"; break; default: /* Check if its a classname. */ @@ -304,15 +300,15 @@ public function format_type_text($type, $tagname) { return ''; } - public function format_type_if_object_or_pseudo_text($type, $tagname) { + public function format_type_if_object_or_pseudo_text($type) { if (in_array(strtolower($type), array("bool", "int", "double", "boolean", "integer", "float", "string", "array", "object", "resource", "null"))) { parent::getPdfDoc()->appendText(" " . $type); return false; } - return self::format_type_text($type, $tagname); + return self::format_type_text($type); } - public function format_collect_id($open, $name, $attrs, $props, $newpage = false) { + public function format_collect_id($open, $name, $attrs) { if ($open && isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { $this->setIdToPage($id); } diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index 16fc41b9..e4ed09ac 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -664,7 +664,7 @@ public function format_type_methodparam_text($type, $tagname) { public function format_type_text($type, $tagname) { $t = strtr(strtolower($type), ["_" => "-", "\\" => "-"]); - $href = $fragment = ""; + $fragment = ""; switch($t) { case "void": diff --git a/phpdotnet/phd/Render.php b/phpdotnet/phd/Render.php index fc0d829b..d58d50e2 100644 --- a/phpdotnet/phd/Render.php +++ b/phpdotnet/phd/Render.php @@ -48,7 +48,7 @@ public function execute(Reader $r) { /* {{{ */ $lastdepth = -1; while($r->read()) { $type = $r->nodeType; - $data = $retval = $name = $open = false; + $open = false; switch($type) { case \XMLReader::ELEMENT: /* {{{ */ diff --git a/phpdotnet/phd/functions.php b/phpdotnet/phd/functions.php index ba566e8f..963d25e7 100644 --- a/phpdotnet/phd/functions.php +++ b/phpdotnet/phd/functions.php @@ -56,7 +56,7 @@ function term_color($text, $color) /* }}} */ /* {{{ The PhD errorhandler */ -function errh($errno, $msg, $file, $line, $ctx = null) { +function errh($errno, $msg, $file, $line) { static $err = array( // PHP Triggered Errors E_DEPRECATED => 'E_DEPRECATED ',