Skip to content

Commit

Permalink
Define undefined properties and variables (#186)
Browse files Browse the repository at this point in the history
Co-authored-by: haszi <haszika80@gmail.com>
  • Loading branch information
haszi and haszi authored Jan 5, 2025
1 parent c22feec commit 92dd87a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions phpdotnet/phd/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ public function getEntryOffset(array $attrs) {
return -1;
}
public function colspan(array $attrs) {
$to = 0;
$from = 0;
if (isset($attrs["namest"])) {
foreach($this->TABLE["colspec"] as $spec) {
if ($spec["colname"] == $attrs["namest"]) {
Expand Down
2 changes: 2 additions & 0 deletions phpdotnet/phd/Highlighter/GeSHi11x.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class Highlighter_GeSHi11x extends Highlighter
{
private $geshi;

/**
* Create a new highlighter instance for the given format.
*
Expand Down
3 changes: 3 additions & 0 deletions phpdotnet/phd/PI/PHPDOCHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ public function parse($target, $data) {
if ($this->format instanceof Index) {
return;
}
$desc = "";
switch($matches["value"]) {
case "function":
case "refentry":
$tmp = $this->format->getRefs();
$refs = array();
$info = array();
$islong = false;
foreach($tmp as $id) {
$filename = $this->format->createLink($id, $desc);
$refs[$filename] = $desc;
Expand Down Expand Up @@ -136,6 +138,7 @@ protected function generateChangelogMarkup($changelogs) {
$ret .= "</tr></thead>";

$version = "";
$desc = "";
foreach($changelogs as $entry) {
if (!$this->_changelogSince || version_compare($entry["version"], $this->_changelogSince) >= 0) {
$link = $this->format->createLink($entry["docbook_id"], $desc);
Expand Down
1 change: 1 addition & 0 deletions phpdotnet/phd/Package/Generic/Manpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class Package_Generic_Manpage extends Format_Abstract_Manpage {
protected $bookName = "";
protected $date = "";

private array $pChunk = [];
/* Current Chunk variables */
protected $cchunk = array();
/* Default Chunk variables */
Expand Down
2 changes: 2 additions & 0 deletions phpdotnet/phd/Package/Generic/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ abstract class Package_Generic_PDF extends Format_Abstract_PDF {
"corefs" => array(),
"callouts" => 0,
);

private array $params = [];

public function __construct(
Config $config,
Expand Down
2 changes: 2 additions & 0 deletions phpdotnet/phd/Package/IDE/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ abstract class Package_IDE_Base extends Format {
'changelog' => array(),
'seealso' => array(),
);

private array $chunkFlags = [];

public function __construct(
Config $config,
Expand Down
5 changes: 5 additions & 0 deletions phpdotnet/phd/Package/PEAR/ChunkedXHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
namespace phpdotnet\phd;

class Package_PEAR_ChunkedXHTML extends Package_PEAR_XHTML {

private array $prev = [];
private array $next = [];
private array $up = [];

public function __construct(
Config $config,
OutputHandler $outputHandler
Expand Down
4 changes: 3 additions & 1 deletion phpdotnet/phd/Package/PEAR/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ abstract class Package_PEAR_XHTML extends Package_Generic_XHTML {
* @var string
*/
public $phd_pearapi_urlprefix = 'http://pear.php.net/package/';

private string $phd_pearapi_text = "";

/* Current Chunk settings */
protected $cchunk = array();
Expand Down Expand Up @@ -541,7 +543,7 @@ public function format_exception_chunk($open, $name, $attrs, $props)
public function format_link($open, $name, $attrs, $props)
{
if ($open) {
$content = $fragment = '';
$content = $fragment = $href = $id = '';
$class = $name;

if (isset($attrs[Reader::XMLNS_DOCBOOK]['linkend'])) {
Expand Down
1 change: 1 addition & 0 deletions phpdotnet/phd/Package/PHP/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ public static function generateAcronymInfo($filename) {
}

$acronyms = array();
$k = "";
while ($r->read()) {
if ($r->nodeType != \XMLReader::ELEMENT) {
continue;
Expand Down

0 comments on commit 92dd87a

Please sign in to comment.