Skip to content

Commit

Permalink
added some TODOs.. fixed typos and a possible bug fix
Browse files Browse the repository at this point in the history
1.    fixed a typo in a final class's protected property, so there can not be any compatibility damage {yaf_route_map.h}
2.    misc typo fixes in documentation
3.    fix a possible bug in yaf_config_simple.c
4.    added TODOs for Yaf_Response methods that needs implementation
  • Loading branch information
elad-yosifon committed Sep 15, 2013
1 parent c88dfa9 commit e366da2
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion configs/yaf_config_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ PHP_METHOD(yaf_config_simple, next) {
*/
PHP_METHOD(yaf_config_simple, valid) {
zval *prop = zend_read_property(yaf_config_simple_ce, getThis(), ZEND_STRL(YAF_CONFIG_PROPERT_NAME), 1 TSRMLS_CC);
RETURN_LONG(zend_hash_has_more_elements(Z_ARRVAL_P(prop)) == SUCCESS);
RETURN_BOOL(zend_hash_has_more_elements(Z_ARRVAL_P(prop)) == SUCCESS);
}
/* }}} */

Expand Down
1 change: 1 addition & 0 deletions package2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<file name="068.phpt" role="test" />
<file name="069.phpt" role="test" />
<file name="070.phpt" role="test" />
<file name="071.phpt" role="test" />
<file name="build.inc" role="test" />
<file name="bug61493.phpt" role="test" />
<file name="bug63381.phpt" role="test" />
Expand Down
2 changes: 1 addition & 1 deletion routes/yaf_route_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef YAF_ROUTER_MAP_H
#define YAF_ROUTER_MAP_H

#define YAF_ROUTE_MAP_VAR_NAME_DELIMETER "_delimeter"
#define YAF_ROUTE_MAP_VAR_NAME_DELIMETER "_delimiter"
#define YAF_ROUTE_MAP_VAR_NAME_CTL_PREFER "_ctl_router"

extern zend_class_entry *yaf_route_map_ce;
Expand Down
2 changes: 1 addition & 1 deletion routes/yaf_route_rewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ int yaf_route_rewrite_route(yaf_route_t *router, yaf_request_t *request TSRMLS_D
}
/* }}} */

/** {{{ proto public Yaf_Route_Rewrite::route(Yaf_Request_Abstarct $request)
/** {{{ proto public Yaf_Route_Rewrite::route(Yaf_Request_Abstract $request)
*/
PHP_METHOD(yaf_route_rewrite, route) {
yaf_route_t *route;
Expand Down
2 changes: 1 addition & 1 deletion routes/yaf_route_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ PHP_METHOD(yaf_route_simple, __construct) {
|| IS_STRING != Z_TYPE_P(controller)
|| IS_STRING != Z_TYPE_P(action)) {
YAF_UNINITIALIZED_OBJECT(getThis());
yaf_trigger_error(YAF_ERR_TYPE_ERROR TSRMLS_CC, "Expect 3 string paramsters", yaf_route_simple_ce->name);
yaf_trigger_error(YAF_ERR_TYPE_ERROR TSRMLS_CC, "Expect 3 string parameters", yaf_route_simple_ce->name);
RETURN_FALSE;
} else {
(void)yaf_route_simple_instance(getThis(), module, controller, action TSRMLS_CC);
Expand Down
2 changes: 1 addition & 1 deletion tests/031.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Array
[_default] => Yaf_Route_Map Object
(
[_ctl_router:protected] => 1
[_delimeter:protected] => ##
[_delimiter:protected] => ##
)

)
14 changes: 14 additions & 0 deletions tests/071.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
return type in Yaf_Simple_Config::valid() should be boolean
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
--FILE--
<?php

$new = new Yaf_Config_Simple(array());
var_dump($new->valid());
?>
--CLEAN--
--EXPECTF--
bool(false)
2 changes: 1 addition & 1 deletion tools/yaf_classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ final class Yaf_Route_Map implements Yaf_Route_Interface {

/* properties */
protected $_ctl_router = "";
protected $_delimeter = NULL;
protected $_delimiter = NULL;

/* methods */
public function __construct($controller_prefer = NULL, $delimiter = NULL) {
Expand Down
8 changes: 6 additions & 2 deletions yaf_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ PHP_METHOD(yaf_response, __construct) {
}
/* }}} */

/** {{{ proto public Yaf_Response_Abstract::__desctruct(void)
/** {{{ proto public Yaf_Response_Abstract::__destruct(void)
*/
PHP_METHOD(yaf_response, __destruct) {
}
/* }}} */

/** {{{ proto public Yaf_Response_Abstract::appenBody($body, $name = NULL)
/** {{{ proto public Yaf_Response_Abstract::appendBody($body, $name = NULL)
*/
PHP_METHOD(yaf_response, appendBody) {
char *body, *name = NULL;
Expand Down Expand Up @@ -314,27 +314,31 @@ PHP_METHOD(yaf_response, prependBody) {
/** {{{ proto public Yaf_Response_Abstract::setHeader($name, $value, $replace = 0)
*/
PHP_METHOD(yaf_response, setHeader) {
//todo: implement
RETURN_FALSE;
}
/* }}} */

/** {{{ proto protected Yaf_Response_Abstract::setAllHeaders(void)
*/
PHP_METHOD(yaf_response, setAllHeaders) {
//todo: implement
RETURN_FALSE;
}
/* }}} */

/** {{{ proto public Yaf_Response_Abstract::getHeader(void)
*/
PHP_METHOD(yaf_response, getHeader) {
//todo: implement
RETURN_NULL();
}
/* }}} */

/** {{{ proto public Yaf_Response_Abstract::clearHeaders(void)
*/
PHP_METHOD(yaf_response, clearHeaders) {
//todo: implement
RETURN_FALSE;
}
/* }}} */
Expand Down

0 comments on commit e366da2

Please sign in to comment.