Pastakhov has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/146040

Change subject: fix argv and toString (v 2.4.1)
......................................................................

fix argv and toString (v 2.4.1)

Change-Id: Id079b0850f28f8b9b907e86b7bbbc615cef089d1
---
M PhpTags.body.php
M PhpTags.php
M includes/GenericObject.php
M includes/PhpTagsException.php
4 files changed, 5 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTags 
refs/changes/40/146040/1

diff --git a/PhpTags.body.php b/PhpTags.body.php
index 64e461e..3309d51 100644
--- a/PhpTags.body.php
+++ b/PhpTags.body.php
@@ -60,8 +60,7 @@
                        // self::$compileTime += microtime(true) - $time;
                        self::$compileTime += 
$parser->mOutput->getTimeSinceStart('cpu') - $time;
 
-                       $arguments = $frame->getArguments();
-                       $arguments[0] = $titleText;
+                       $arguments = array( $titleText ) + 
$frame->getArguments();
 
                        $result = \PhpTags\Runtime::run(
                                        $bytecode,
@@ -110,8 +109,7 @@
                        // self::$compileTime += microtime(true) - $time;
                        self::$compileTime += 
$parser->mOutput->getTimeSinceStart('cpu') - $time;
 
-                       $arguments = $frame->getArguments();
-                       $arguments[0] = $titleText;
+                       $arguments = array( $titleText ) + 
$frame->getArguments();
 
                        $result = \PhpTags\Runtime::run(
                                        $bytecode,
diff --git a/PhpTags.php b/PhpTags.php
index 21a74b8..40b8bc7 100644
--- a/PhpTags.php
+++ b/PhpTags.php
@@ -17,7 +17,7 @@
 
 define( 'PHPTAGS_MAJOR_VERSION', 2 );
 define( 'PHPTAGS_MINOR_VERSION', 4 );
-define( 'PHPTAGS_RELEASE_VERSION', 0 );
+define( 'PHPTAGS_RELEASE_VERSION', 1 );
 define( 'PHPTAGS_VERSION', PHPTAGS_MAJOR_VERSION . '.' . PHPTAGS_MINOR_VERSION 
. '.' . PHPTAGS_RELEASE_VERSION );
 
 define( 'PHPTAGS_HOOK_RELEASE', 3 );
diff --git a/includes/GenericObject.php b/includes/GenericObject.php
index b96cc9e..db454f4 100644
--- a/includes/GenericObject.php
+++ b/includes/GenericObject.php
@@ -76,7 +76,7 @@
         * @return string
         */
        public function toString() {
-               return 'object';
+               throw new PhpTagsException( 
PHPTAGS_EXCEPTION_FATAL_OBJECT_COULD_NOT_BE_CONVERTED, array( $this->name, 
'string' ) );
        }
 
 }
diff --git a/includes/PhpTagsException.php b/includes/PhpTagsException.php
index 2561e90..4d39b6e 100644
--- a/includes/PhpTagsException.php
+++ b/includes/PhpTagsException.php
@@ -49,7 +49,7 @@
 define( 'PHPTAGS_EXCEPTION_FATAL_INVALID_CONSTANT_CLASS', 4016 );
 
 define( 'PHPTAGS_EXCEPTION_CATCHABLE_FATAL', 5 );
-define( 'PHPTAGS_EXCEPTION_FATAL_OBJECT_COULD_NOT_BE_CONVERTED', 6001 ); //PHP 
Catchable fatal error:  Object of class stdClass could not be converted to 
string
+define( 'PHPTAGS_EXCEPTION_FATAL_OBJECT_COULD_NOT_BE_CONVERTED', 5001 ); //PHP 
Catchable fatal error:  Object of class stdClass could not be converted to 
string
 
 define( 'PHPTAGS_EXCEPTION_PARSE', 6 );
 define( 'PHPTAGS_EXCEPTION_SYNTAX_ERROR_UNEXPECTED', 6001 ); // PHP Parse 
error:  syntax error, unexpected $end, expecting ',' or ';' in Command line 
code on line 1

-- 
To view, visit https://gerrit.wikimedia.org/r/146040
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id079b0850f28f8b9b907e86b7bbbc615cef089d1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTags
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to