Skip to content
Open
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 package-pman.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

PEAR::setErrorHandling(PEAR_ERROR_DIE);

$packagexml = new PEAR_PackageFileManager2;
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array(
"outputdirectory" => ".",
"filelistgenerator" => "file",
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function setColorOutput(bool $colorOutput): void {
* the manual docbook file are compared. If the index is older than
* the docbook file, indexing will be done.
*
* @return boolean True if indexing is required.
* @return bool True if indexing is required.
*/
public function requiresIndexing(): bool {
if (! $this->indexCache) {
Expand Down
20 changes: 10 additions & 10 deletions phpdotnet/phd/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ abstract class Format extends ObjectStorage
* Represents a short description.
* Used in createLink()
*
* @var integer
* @var int
* @usedby createLink()
*/
const SDESC = 1;
public const SDESC = 1;

/**
* Represents a long description.
* Used in createLink()
*
* @var integer
* @var int
* @usedby createLink()
*/
const LDESC = 2;
public const LDESC = 2;

protected Config $config;
protected OutputHandler $outputHandler;
Expand Down Expand Up @@ -86,7 +86,7 @@ abstract public function CDATA($value);
*
* @param string $for Chunk ID
* @param string &$desc Description of link, to be filled if neccessary
* @param integer $type Format of description, Format::SDESC or
* @param int $type Format of description, Format::SDESC or
* Format::LDESC
*
* @return string|null|void Relative or absolute URI to access $for
Expand Down Expand Up @@ -121,21 +121,21 @@ abstract public function appendData($data);
* Called when a new chunk is opened or closed.
* Value is either Render::OPEN or Render::CLOSE
*
* @param integer $event Event flag (see Render class)
* @param int $event Event flag (see Render class)
* @param mixed $value Additional value flag. Depends
* on $event type
*
* @return void
*/
abstract public function update($event, $value = null);

public final function parsePI($target, $data) {
final public function parsePI($target, $data) {
if (isset($this->pihandlers[$target])) {
return $this->pihandlers[$target]->parse($target, $data);
}
}

public final function registerPIHandlers($pihandlers) {
final public function registerPIHandlers($pihandlers) {
foreach ($pihandlers as $target => $classname) {
$class = __NAMESPACE__ . "\\" . $classname;
$this->pihandlers[$target] = new $class($this);
Expand Down Expand Up @@ -172,7 +172,7 @@ public function SQLiteIndex($context, $index, $id, $filename, $parent, $sdesc, $
/**
* Calls update().
*
* @param integer $event Event flag. See Render class for constants
* @param int $event Event flag. See Render class for constants
* like Render::INIT and Render::CHUNK
* @param mixed $val Value; depends on $event flag
*
Expand Down Expand Up @@ -421,7 +421,7 @@ final public function getChildren($id)
*
* @param string $id XML ID to get chunk status for
*
* @return boolean True if it is to be chunked
* @return bool True if it is to be chunked
*/
final public function isChunkID($id)
{
Expand Down
22 changes: 11 additions & 11 deletions phpdotnet/phd/Format/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ abstract class Format_Factory {
private $optionsHandler = null;
private $pversion = "unknown";

public final function getPackageVersion() {
final public function getPackageVersion() {
return $this->pversion;
}
public final function setPackageVersion($version) {
final public function setPackageVersion($version) {
$this->pversion = $version;
}
public final function getOutputFormats() {
final public function getOutputFormats() {
return array_keys($this->formats);
}

public final function registerOutputFormats($formats) {
final public function registerOutputFormats($formats) {
$this->formats = $formats;
}

public final function getOptionsHandler() {
final public function getOptionsHandler() {
return $this->optionsHandler;
}

public final function registerOptionsHandler(Options_Interface $optionsHandler) {
final public function registerOptionsHandler(Options_Interface $optionsHandler) {
$this->optionsHandler = $optionsHandler;
}

protected final function setPackageName($name) {
final protected function setPackageName($name) {
if (!is_string($name)) {
throw new \Exception("Package names must be strings..");
}
$this->packageName = $name;
}
public final function getPackageName() {
final public function getPackageName() {
return $this->packageName;
}

public final function createFormat($format, ...$formatParams) {
final public function createFormat($format, ...$formatParams) {
if (isset($this->formats[$format]) && $this->formats[$format]) {
$classname = __NAMESPACE__ . "\\" . $this->formats[$format];

Expand All @@ -52,7 +52,7 @@ public final function createFormat($format, ...$formatParams) {
trigger_error("This format is not supported by this package", E_USER_ERROR);
}

public static final function createFactory($package) {
final public static function createFactory($package) {
static $factories = array();

if (!is_string($package)) {
Expand All @@ -71,7 +71,7 @@ public static final function createFactory($package) {
return $factories[$package];
}

public final function __toString() {
final public function __toString() {
return $this->getPackageName();
}
}
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function highlight($text, $role, $format)
return "\n.PP\n.nf\n"
. str_replace("\\", "\\\\", trim($text))
. "\n.fi";
} else if ($format != 'xhtml') {
} elseif ($format != 'xhtml') {
return $text;
}

Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Highlighter/GeSHi11x.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function factory($format)
require_once GESHI_CLASSES_ROOT
. 'renderers/class.' . strtolower($rendererclass) . '.php';
$rendererclass = '\\' . $rendererclass;
$renderer = new $rendererclass;
$renderer = new $rendererclass();


return new self($renderer);
Expand Down
4 changes: 2 additions & 2 deletions phpdotnet/phd/MediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MediaManager
/**
* If the image media directory exists
*
* @var boolean
* @var bool
*/
protected $media_dir_exists = false;

Expand Down Expand Up @@ -109,7 +109,7 @@ protected function copyOver($filename, $newpath)
* based upon a specific language, then fallback to the English translation.
*
* @param string $filename Original filename
* @param boolean $allowfallback If the required file cannot be found then fallback to English
* @param bool $allowfallback If the required file cannot be found then fallback to English
*
* @return string Exact location of the file referenced with $filename or False if file not found.
*/
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/PIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct($format) {
$this->format = $format;
}

public abstract function parse($target, $data);
abstract public function parse($target, $data);

}

Expand Down
6 changes: 2 additions & 4 deletions phpdotnet/phd/Package/Generic/ChunkedXHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ public function update($event, $value = null) {
if (!is_dir($this->getOutputDir())) {
trigger_error("Output directory is a file?", E_USER_ERROR);
}
} else {
if (!mkdir($this->getOutputDir(), 0777, true)) {
trigger_error("Can't create output directory", E_USER_ERROR);
}
} elseif (!mkdir($this->getOutputDir(), 0777, true)) {
trigger_error("Can't create output directory", E_USER_ERROR);
}
if ($this->config->css) {
$this->fetchStylesheet();
Expand Down
10 changes: 4 additions & 6 deletions phpdotnet/phd/Package/Generic/Manpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
namespace phpdotnet\phd;

class Package_Generic_Manpage extends Format_Abstract_Manpage {
const OPEN_CHUNK = 0x01;
const CLOSE_CHUNK = 0x02;
public const OPEN_CHUNK = 0x01;
public const CLOSE_CHUNK = 0x02;

private $elementmap = array( /* {{{ */
'acronym' => 'format_suppressed_tags',
Expand Down Expand Up @@ -318,10 +318,8 @@ public function update($event, $value = null) {
if (!is_dir($this->getOutputDir())) {
trigger_error("Output directory is a file?", E_USER_ERROR);
}
} else {
if (!mkdir($this->getOutputDir(), 0777, true)) {
trigger_error("Can't create output directory", E_USER_ERROR);
}
} elseif (!mkdir($this->getOutputDir(), 0777, true)) {
trigger_error("Can't create output directory", E_USER_ERROR);
}
break;
case Render::VERBOSE:
Expand Down
14 changes: 6 additions & 8 deletions phpdotnet/phd/Package/Generic/TocFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function close()
* Called when a new chunk is opened or closed.
* Value is either Render::OPEN or Render::CLOSE
*
* @param integer $event Event flag (see Render class)
* @param int $event Event flag (see Render class)
* @param mixed $value Additional value flag. Depends
* on $event type
*
Expand All @@ -226,10 +226,8 @@ public function update($event, $value = null)
if (!is_dir($dir)) {
trigger_error("Output directory is a file?", E_USER_ERROR);
}
} else {
if (!mkdir($dir, 0777, true)) {
trigger_error("Can't create output directory", E_USER_ERROR);
}
} elseif (!mkdir($dir, 0777, true)) {
trigger_error("Can't create output directory", E_USER_ERROR);
}
break;

Expand Down Expand Up @@ -267,7 +265,7 @@ public function appendData($data)
* header and footer
* @param string $content XML Atom content to save
*
* @return boolean True if the file has been written, false if not.
* @return bool True if the file has been written, false if not.
*
* @uses Format::getFilename()
* @uses header()
Expand Down Expand Up @@ -297,7 +295,7 @@ public function writeChunk($id, $content)
/**
* Format a chunked element
*
* @param boolean $open If the tag is opened or closed
* @param bool $open If the tag is opened or closed
* @param string $name Name of the tag
* @param array $attrs XML tag attributes
* @param array $props FIXME
Expand Down Expand Up @@ -493,7 +491,7 @@ public function CDATA($value)
* @param string $for Chunk ID
* @param string &$desc Description of link, to be filled if neccessary.
* Not used here.
* @param integer $type Format of description, Format::SDESC or
* @param int $type Format of description, Format::SDESC or
* Format::LDESC.
* Not used here.
*
Expand Down
Loading