Pastakhov has uploaded a new change for review.
https://gerrit.wikimedia.org/r/168944
Change subject: add Hooks::TYPE_BOOL (v 3.5.2)
......................................................................
add Hooks::TYPE_BOOL (v 3.5.2)
Change-Id: Ic077b19a600298d824b69db2ff6a4d2fe6d4ad83
---
M includes/GenericObject.php
M includes/Hooks.php
2 files changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTags
refs/changes/44/168944/1
diff --git a/includes/GenericObject.php b/includes/GenericObject.php
index cde0168..bfda318 100644
--- a/includes/GenericObject.php
+++ b/includes/GenericObject.php
@@ -168,11 +168,16 @@
$error =
'scalar';
break 2;
}
+ break;
case Hooks::TYPE_NOT_OBJECT:
if ( true ===
is_object( $arguments[$i] ) ) {
$error = 'not
object';
break 2;
}
+ break;
+ case Hooks::TYPE_BOOL:
+ $arguments[$i] =
(bool)$arguments[$i];
+ break;
}
} elseif ( false === $arguments[$i] instanceof
GenericObject || $arguments[$i]->name != $expects[$i] ) {
$error = $expects[$i];
diff --git a/includes/Hooks.php b/includes/Hooks.php
index e8c7c7f..1c190ed 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -24,6 +24,7 @@
const TYPE_INT = 7;
const TYPE_FLOAT = 8;
const TYPE_NOT_OBJECT = 9;
+ const TYPE_BOOL = 10;
/**
* When accessing static objects, the object name is placed here.
--
To view, visit https://gerrit.wikimedia.org/r/168944
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic077b19a600298d824b69db2ff6a4d2fe6d4ad83
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