Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpdotnet/phd/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 2 additions & 3 deletions phpdotnet/phd/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 3 additions & 5 deletions phpdotnet/phd/Format/Abstract/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -94,7 +93,6 @@ class PdfWriter {
private $currentFontColor;
private $fonts;
private $oldFonts = array();
private $text;

private $vOffset = 0;
private $hOffset = 0;
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/MediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions phpdotnet/phd/Options/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/PI/PHPDOCHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions phpdotnet/phd/Package/Generic/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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"]) {
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Package/Generic/TocFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions phpdotnet/phd/Package/Generic/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";

Expand Down Expand Up @@ -855,7 +854,6 @@ public function format_container_chunk_below($open, $name, $attrs, $props) {
}

$toc = '<ol>';
$desc = "";
if (!in_array($id, $this->TOC_WRITTEN ?? [])) {
$toc = $this->createTOC($id, $name, $props);
}
Expand Down Expand Up @@ -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 '<a href="#fnid' .$note["id"]. '"><sup>[' .($k + 1). ']</sup></a>';
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PEAR/ChunkedXHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PEAR/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public function header($id)
public function footer($id)
{
$ext = $this->ext;
$parent = Format::getParent($id);

return '<?php manualFooter("'
. $this->getFilename($id) . $ext . '", '
Expand Down
3 changes: 0 additions & 3 deletions phpdotnet/phd/Package/PHP/ChunkedXHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -30,7 +28,6 @@ public function header($id) {
</head>
<body class="docs">
HEADER;
$next = $prev = $up = array("href" => null, "desc" => null);
$nextLink = $prevLink = $upLink = '';
if ($prevId = Format::getPrevious($id)) {
$prev = array(
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PHP/HowTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PHP/KDevelop.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Package/PHP/Manpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
12 changes: 4 additions & 8 deletions phpdotnet/phd/Package/PHP/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ class Package_PHP_PDF extends Package_Generic_PDF {

);

private $acronyms = array();

/* Common properties for all functions pages */
protected $bookName = "";

Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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. */
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Package/PHP/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: /* {{{ */
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ',
Expand Down
Loading