Doc #76341 [NEW]: Tidy class doc: a contribute
| From: | salsi at icosaedro dot it | Date: | Tue, 15 May 2018 10:57:00 +0000 |
| Subject: | Doc #76341 [NEW]: Tidy class doc: a contribute | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-15692@lists.php.net to get a copy of this message | ||
From: salsi at icosaedro dot it
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Tidy class doc: a contribute
Description:
------------
To integrate the documentation about the tidy class, here is what I
found so far by testing with actual code; please consider for a possible
merge with the current documentation as there are several detailed
annotations:
class tidy {
/**
* Informational, warning and error messages collected while parsing.
* Lines are separated by '\r\n'; a trailing '\r' is also added for
some
* reason. The NULL value means either no parsing has still being
performed
* or the parsing succeeded.
* @var string
*/
public $errorBuffer;
/**
* Initializes a new parser and possibly also parse the specified
file.
* Hint: to parse a string, do not specify any argument and then use
the
* parseString() method instead.
* @param string $filename File to parse. If this argument is provided,
it
* must be a valid existing file name.
* @param mixed $config String of the configuration options or
associative
* array of the options. Set the empty array here if you want to set
the
* following arguments too.
* @param string $encoding Encoding for input and output documents.
* Note that the tidy library still can't parse a possible HTML META
element
* specifying the encoding, so setting this argument is advised.
* Default input encoding: unspecified, possibly unexpected.
* Default output encoding: UTF8.
* BEWARE: "UTF-8" is not a recognized encoding; "UTF8" is the right
spelling.
* @param boolean $use_include_path If true, a relative $filename path
is
* resolved first against the directories listed in the include_path
php.ini
* directive, and then search in the current directory. Default:
FALSE.
* @return void
* @triggers E_WARNING Failed reading $filename. Failed reading the
$config
* file when this argument is a string. Invalid $encoding.
* @triggers E_NOTICE Unknown or invalid $config when this argument is
an
* associative array.
*/
function __construct($filename = NULL, $config = NULL, $encoding =
NULL,
$use_include_path = FALSE){}
/**
* Returns the node starting with the BODY element.
* @return tidyNode The BODY element, either parsed or added by this
library.
* Returns NULL if still no parsing performed.
*/
function body(){}
// Other methods: cleanRepair(), diagnose(), getConfig(), getHtmlVer()
/**
* Returns the value of the specified option.
* @param string $option Name of the option to retrieve.
* @return mixed Value of the option.
* @triggers E_WARNING No this option.
*/
function getOpt(/*. string .*/ $option){}
/**
* Returns the documentation for the given option name.
* @param string $optname
* @return string
* @deprecated This method is not available; tested with getRelease()
gives 2017/03/01
* on Wamp Server with PHP 7.1.9.
*/
function getOptDoc($optname){}
/**
* Return the release date of the tidy library.
* @return string
*/
function getRelease(){}
/**
* Returns the status of the document.
* @return int
*/
function getStatus(){}
/**
* Returns the HEAD element.
* @return tidyNode The HEAD element, or NULL if not available.
*/
function head(){}
/**
* Returns the HTML element.
* @return tidyNode The HTML element, or NULL if not available.
*/
function html(){}
/**
* Tells if the document is XHTML.
* @return boolean
*/
function isXhtml(){}
/**
* Tells if the document is XML.
* @return boolean
*/
function isXml(){}
/**
* Parse the given file.
* @param string $filename File to parse.
* @param mixed $config String of the configuration options or
associative
* array of the options. Set the empty array here if you want to set
the
* following arguments too.
* @param string $encoding Encoding for input and output documents.
* Note that the tidy library still can't parse a possible HTML META
element
* specifying the encoding, so setting this argument is advised.
* Default input encoding: unspecified, possibly unexpected.
* Default output encoding: UTF-8.
* BEWARE: "UTF-8" is not a recognized encoding; "UTF8" is the right
spelling.
* @param boolean $use_include_path If true, a relative $filename path
is
* resolved first against the directories listed in the include_path
php.ini
* directive, and then search in the current directory. Default:
FALSE.
* @return boolean Always returns TRUE.
* @triggers E_WARNING Failed reading $filename. Failed reading the
$config
* file when this argument is a string. Invalid $encoding.
* @triggers E_NOTICE Unknown or invalid $config when this argument is
an
* associative array.
*/
function parseFile($filename, $config = NULL, $encoding = NULL,
$use_include_path = FALSE){}
/**
* Parse the given string.
* @param string $input Text to parse.
* @param mixed $config String of the configuration options or
associative
* array of the options. Set the empty array here if you want to set
the
* following arguments too.
* @param string $encoding Encoding for input and output documents.
* Note that the tidy library still can't parse a possible HTML META
element
* specifying the encoding, so setting this argument is advised.
* Default input encoding: unspecified, possibly unexpected.
* Default output encoding: UTF-8.
* BEWARE: "UTF-8" is not a recognized encoding; "UTF8" is the right
spelling.
* @return boolean Always returns TRUE.
* @triggers E_WARNING Failed reading the $config file when this
argument is
* a string. Invalid $encoding.
* @triggers E_NOTICE Unknown or invalid $config when this argument is
an
* associative array.
*/
function parseString($input, $config = NULL, $encoding = NULL){}
/**
* Parse the given file and returns the repaired result.
* @param string $filename File to parse. If this argument is provided,
it
* must be a valid existing file name.
* @param mixed $config String of the configuration options or
associative
* array of the options. Set the empty array here if you want to set
the
* following arguments too.
* @param string $encoding Encoding for input and output documents.
* Note that the tidy library still can't parse a possible HTML META
element
* specifying the encoding, so setting this argument is advised.
* Default input encoding: unspecified, possibly unexpected.
* Default output encoding: UTF-8.
* BEWARE: "UTF-8" is not a recognized encoding; "UTF8" is the right
spelling.
* @param boolean $use_include_path If true, a relative $filename path
is
* resolved first against the directories listed in the include_path
php.ini
* directive, and then search in the current directory. Default:
FALSE.
* @return string Repaired contents of the file.
* @triggers E_WARNING Failed reading $filename. Failed reading the
$config
* file when this argument is a string. Invalid $encoding.
* @triggers E_NOTICE Unknown or invalid $config when this argument is
an
* associative array.
*/
function repairFile($filename, $config = NULL, $encoding = NULL,
$use_include_path = FALSE){}
/**
* Parse the given string and returns the repaired result.
* @param string $input Text to parse.
* @param mixed $config String of the configuration options or
associative
* array of the options. Set the empty array here if you want to set
the
* following arguments too.
* @param string $encoding Encoding for input and output documents.
* Note that the tidy library still can't parse a possible HTML META
element
* specifying the encoding, so setting this argument is advised.
* Default input encoding: unspecified, possibly unexpected.
* Default output encoding: UTF-8.
* BEWARE: "UTF-8" is not a recognized encoding; "UTF8" is the right
spelling.
* @return string Repaired contents of the string.
* @triggers E_WARNING Failed reading the $config file when this
argument is
* a string. Invalid $encoding.
* @triggers E_NOTICE Unknown or invalid $config when this argument is
an
* associative array.
*/
function repairString($input, $config = NULL, $encoding = NULL){}
/**
* Returns the root node of the parsed tree.
* @return tidyNode Root note of the parsed tree, possibly a tidyNode
with
* empty name property if nothing has been parsed yet.
*/
function root(){}
}
--
Edit bug report at https://bugs.php.net/bug.php?id=76341&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76341&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76341&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76341&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76341&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76341&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76341&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76341&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76341&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76341&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76341&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76341&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76341&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76341&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76341&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76341&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76341&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76341&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76341&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76341&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76341&r=mysqlcfg