scottmac Thu, 03 Feb 2011 16:29:23 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=307976
Log:
Fix docblocks on SpoofChecker and remove exceptions after discussion with Stas.
Changed paths:
U php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c
Modified: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c
===================================================================
--- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c 2011-02-03
13:33:10 UTC (rev 307975)
+++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c 2011-02-03
16:29:23 UTC (rev 307976)
@@ -21,7 +21,7 @@
#include "php_intl.h"
#include "spoofchecker_class.h"
-/* {{{ proto bool Spoofchecker::isSuspicious( string $text[, int $error_code ]
)
+/* {{{ proto bool Spoofchecker::isSuspicious( string text[, int &error_code ] )
* Checks if a given text contains any suspicious characters
*/
PHP_METHOD(Spoofchecker, isSuspicious)
@@ -41,8 +41,8 @@
ret = uspoof_checkUTF8(co->uspoof, text, text_len, NULL,
SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C),
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)
TSRMLS_CC);
- return;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%ld) %s",
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co));
+ RETURN_TRUE;
}
if (error_code) {
@@ -53,7 +53,7 @@
}
/* }}} */
-/* {{{ proto bool Spoofchecker::areConfusable( string $str1, string $str2[,
int $error_code ] )
+/* {{{ proto bool Spoofchecker::areConfusable( string str1, string str2[, int
&error_code ] )
* Checks if a given text contains any confusable characters
*/
PHP_METHOD(Spoofchecker, areConfusable)
@@ -74,8 +74,8 @@
ret = uspoof_areConfusableUTF8(co->uspoof, s1, s1_len, s2, s2_len,
SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C),
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)
TSRMLS_CC);
- return;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%ld) %s",
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co));
+ RETURN_TRUE;
}
if (error_code) {
@@ -86,7 +86,7 @@
}
/* }}} */
-/* {{{ proto void Spoofchecker::setAllowedLocales( string $locales )
+/* {{{ proto void Spoofchecker::setAllowedLocales( string locales )
* Locales to use when running checks
*/
PHP_METHOD(Spoofchecker, setAllowedLocales)
@@ -105,13 +105,13 @@
uspoof_setAllowedLocales(co->uspoof, locales,
SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C),
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)
TSRMLS_CC);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%ld) %s",
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co));
return;
}
}
/* }}} */
-/* {{{ proto void Spoofchecker::setChecks( int $checks )
+/* {{{ proto void Spoofchecker::setChecks( int checks )
* Set the checks to run
*/
PHP_METHOD(Spoofchecker, setChecks)
@@ -129,8 +129,7 @@
uspoof_setChecks(co->uspoof, checks, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C),
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)
TSRMLS_CC);
- return;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%ld) %s",
u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co));
}
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php