Skip to content
Browse files

Bug #14560 yields warnings from E_STRICT

git-svn-id: http://svn.php.net/repository/pear/packages/Text_Highlighter/trunk@295959 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 778fab1 commit 5ec09f69422055084dc5d9b59c1ae347228ee918 @CloCkWeRX CloCkWeRX committed Mar 8, 2010
Showing with 20 additions and 20 deletions.
  1. +4 −4 Highlighter.php
  2. +1 −1 Highlighter/Generator.php
  3. +2 −2 Highlighter/Renderer/XML.php
  4. +10 −10 README
  5. +1 −1 generate
  6. +1 −1 generate.bat
  7. +1 −1 package.php
View
8 Highlighter.php
@@ -83,7 +83,7 @@
* Usage example
* <code>
*require_once 'Text/Highlighter.php';
- *$hlSQL =& Text_Highlighter::factory('SQL',array('numbers'=>true));
+ *$hlSQL = Text_Highlighter::factory('SQL',array('numbers'=>true));
*echo $hlSQL->highlight('SELECT * FROM table a WHERE id = 12');
* </code>
*
@@ -207,7 +207,7 @@ function &factory($lang, $options = array())
return PEAR::raiseError('Highlighter for ' . $lang . ' not found');
}
- $obj =& new $classname($options);
+ $obj = new $classname($options);
return $obj;
}
@@ -224,7 +224,7 @@ function &factory($lang, $options = array())
*/
function setRenderer(&$renderer)
{
- $this->_renderer =& $renderer;
+ $this->_renderer = $renderer;
}
// }}}
@@ -361,7 +361,7 @@ function highlight($str)
{
if (!($this->_renderer)) {
include_once('Text/Highlighter/Renderer/Html.php');
- $this->_renderer =& new Text_Highlighter_Renderer_Html($this->_options);
+ $this->_renderer = new Text_Highlighter_Renderer_Html($this->_options);
}
$this->_state = -1;
$this->_pos = 0;
View
2 Highlighter/Generator.php
@@ -56,7 +56,7 @@
* Usage example
* <code>
*require_once 'Text/Highlighter/Generator.php';
-*$generator =& new Text_Highlighter_Generator('php.xml');
+*$generator = new Text_Highlighter_Generator('php.xml');
*$generator->generate();
*$generator->saveCode('PHP.php');
* </code>
View
4 Highlighter/Renderer/XML.php
@@ -83,7 +83,7 @@ function finalize()
parent::finalize();
$output = parent::getOutput();
- $serializer =& new XML_Serializer($this->_serializer_options);
+ $serializer = new XML_Serializer($this->_serializer_options);
$result = $serializer->serialize($output);
if ($result === true) {
$this->_output = $serializer->getSerializedData();
@@ -101,4 +101,4 @@ function finalize()
* End:
*/
-?>
+?>
View
20 README
@@ -179,7 +179,7 @@ element of "defines" option:
),
'numbers' => HL_NUMBERS_TABLE,
);
- $highlighter =& Text_Highlighter::factory('java', $options);
+ $highlighter = Text_Highlighter::factory('java', $options);
"ifndef" attribute has reverse meaning.
@@ -196,7 +196,7 @@ the process. To generate the class, you need just few lines of code:
<?php
require_once 'Text/Highlighter/Generator.php';
- $generator =& new Text_Highlighter_Generator('php.xml');
+ $generator = new Text_Highlighter_Generator('php.xml');
$generator->generate();
$generator->saveCode('PHP.php');
?>
@@ -337,7 +337,7 @@ HTML renderer accepts following options (each being optional):
'numbers' => HL_NUMBERS_LI,
'tabsize' => 8,
);
- $renderer =& new Text_Highlighter_Renderer_HTML($options);
+ $renderer = new Text_Highlighter_Renderer_HTML($options);
Console renderer
----------------
@@ -360,7 +360,7 @@ option - a boolean value, and 'tabsize' option.
'tabsize' => 8,
'colors' => $colors,
);
- $renderer =& new Text_Highlighter_Renderer_Console($options);
+ $renderer = new Text_Highlighter_Renderer_Console($options);
ANSI color escape sequences have the following format:
@@ -404,7 +404,7 @@ To create a highlighter for a certain language, use Text_Highlighter::factory()
static method:
require_once 'Text/Highlighter.php';
- $hl =& Text_Highlighter::factory('php');
+ $hl = Text_Highlighter::factory('php');
Setting a renderer
@@ -418,8 +418,8 @@ Actual output is produced by a renderer.
'numbers' => HL_NUMBERS_LI,
'tabsize' => 8,
);
- $renderer =& new Text_Highlighter_Renderer_HTML($options);
- $hl =& Text_Highlighter::factory('php');
+ $renderer = new Text_Highlighter_Renderer_HTML($options);
+ $hl = Text_Highlighter::factory('php');
$hl->setRenderer($renderer);
Note that for BC reasons, it is possible to use highlighter without setting a
@@ -432,7 +432,7 @@ following example works exactly as previous one:
'numbers' => HL_NUMBERS_LI,
'tabsize' => 8,
);
- $hl =& Text_Highlighter::factory('php', $options);
+ $hl = Text_Highlighter::factory('php', $options);
Getting output
@@ -446,8 +446,8 @@ And finally, do the highlighting and get the output:
'numbers' => HL_NUMBERS_LI,
'tabsize' => 8,
);
- $renderer =& new Text_Highlighter_Renderer_HTML($options);
- $hl =& Text_Highlighter::factory('php');
+ $renderer = new Text_Highlighter_Renderer_HTML($options);
+ $hl = Text_Highlighter::factory('php');
$hl->setRenderer($renderer);
$html = $hl->highlight(file_get_contents('example.php'));
View
2 generate
@@ -111,7 +111,7 @@ if ($dir && substr($dir,-1)!='/' && substr($dir,-1)!=='\\' ) {
foreach ($source as $i => $xmlfile)
{
- $gen =& new Text_Highlighter_Generator;
+ $gen = new Text_Highlighter_Generator;
$gen->setInputFile($xmlfile);
if ($gen->hasErrors()) {
break;
View
2 generate.bat
@@ -126,7 +126,7 @@ if ($dir && substr($dir,-1)!='/' && substr($dir,-1)!=='\\' ) {
foreach ($source as $i => $xmlfile)
{
- $gen =& new Text_Highlighter_Generator;
+ $gen = new Text_Highlighter_Generator;
$gen->setInputFile($xmlfile);
if ($gen->hasErrors()) {
break;
View
2 package.php
@@ -35,7 +35,7 @@
die($xmlfile . ' : no Id CVS tag found');
}
$cvsid = $m[1];
- $gen =& new Text_Highlighter_Generator;
+ $gen = new Text_Highlighter_Generator;
$gen->setInputFile($xmlfile);
if ($gen->hasErrors()) {
break;

0 comments on commit 5ec09f6

Please sign in to comment.
Something went wrong with that request. Please try again.