Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Aug 16, 2012
1 parent cb193ef commit 7f0ef9c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
4 changes: 2 additions & 2 deletions application/configuration/modules.php
@@ -1,2 +1,2 @@
<?php
return array();
<?php
return array();
2 changes: 1 addition & 1 deletion framework/Koch/Datatype/Xml.php
Expand Up @@ -100,7 +100,7 @@ public static function toArray($xml, $recursionDepth=0)
}
}

if( is_a($xml, 'SimpleXMLElement') ) { // works (no longer deprecated as of php 5.3.0)
if ( is_a($xml, 'SimpleXMLElement') ) { // works (no longer deprecated as of php 5.3.0)
#if ($xml instanceof SimpleXMLElement) { <= fails with php 5.3.5
// Get a copy of the simpleXmlElementObject
$copy_of_xml_object = $xml;
Expand Down
12 changes: 6 additions & 6 deletions framework/Koch/Exception/Errorhandler.php
Expand Up @@ -184,12 +184,12 @@ public static function errorhandler( $errno, $errstr, $errfile, $errline, $errco
* is only displayed, when Koch Framework runs in DEVELOPMENT Mode.
* @see addTemplateEditorLink()
*
* @param integer $errno contains the error as integer
* @param string $errstr contains error string info
* @param string $errfile contains the filename with occuring error
* @param string $errline contains the line of error
* @param array $errcontext contains vars from error context
* @return string HTML with Smarty Error Text and Link.
* @param integer $errno contains the error as integer
* @param string $errstr contains error string info
* @param string $errfile contains the filename with occuring error
* @param string $errline contains the line of error
* @param array $errcontext contains vars from error context
* @return string HTML with Smarty Error Text and Link.
*/
private static function smarty_error_display($errno, $errorname, $errstr, $errfile, $errline, $errcontext)
{
Expand Down
12 changes: 6 additions & 6 deletions framework/Koch/Mvc/Mapper.php
Expand Up @@ -56,8 +56,8 @@ class Mapper extends \ArrayObject
/**
* Maps the controller and subcontroller (optional) to filename
*
* @param string $module_path Path to Module
* @param string $controller Name of Controller
* @param string $module_path Path to Module
* @param string $controller Name of Controller
* @return string filename
*/
public static function mapControllerToFilename($module_path, $controller = null)
Expand All @@ -74,15 +74,15 @@ public static function mapControllerToFilename($module_path, $controller = null)
/**
* Maps Controller to Classname
*
* @param string $module Name of Module
* @param string $controller Name of Controller (optional)
* @param string $module Name of Module
* @param string $controller Name of Controller (optional)
* @return string classname
*/
public static function mapControllerToClassname($module, $controller = null)
{
$classname = '\\';

if($controller === null) {
if ($controller === null) {
// the default controller of a module is named like the module
// The module "News" has a controller named "News"Controller.
$controller = $module;
Expand All @@ -108,7 +108,7 @@ public static function mapControllerToClassname($module, $controller = null)
* The convention is action_<action> !
*
*
* @param string $action the action
* @param string $action the action
* @return string the mapped method name
*/
public static function mapActionToMethodname($action)
Expand Down
11 changes: 4 additions & 7 deletions framework/Koch/Router/Router.php
Expand Up @@ -344,7 +344,7 @@ public function generateURL($url_pattern, array $params = null, $absolute = fals
public static function buildURL($urlstring, $encode = true, $force_modrewrite_on = true)
{
// if urlstring is array, then a relation (urlstring => parameter_order) is given
if(is_array($urlstring)) {
if (is_array($urlstring)) {
$parameter_order = '';
list($urlstring, $parameter_order) = each($urlstring);
}
Expand Down Expand Up @@ -389,17 +389,14 @@ public static function buildURL($urlstring, $encode = true, $force_modrewrite_on
$url_parameters = explode('/', $urlstring);

// do we have a parameter_order given?
if(isset($parameter_order))
{
if (isset($parameter_order)) {
// replace parameter names with shorthands used in the url
$search = array('module', 'controller', 'action');
$replace = array('mod', 'ctrl', 'action');
$parameter_order = str_replace($search, $replace, $parameter_order);

$url_keys = explode('/', $parameter_order);
}
else
{
} else {
// default static whitelist for url parameter keys
$url_keys = array('mod', 'ctrl', 'action', 'id', 'type');
}
Expand Down Expand Up @@ -555,7 +552,7 @@ public function match()
*
* unset everything, keep only $route_values['required'].
*/
for($i = 0; $i <= $route_values['number_of_segments']; $i++) {
for ($i = 0; $i <= $route_values['number_of_segments']; $i++) {
unset($matches[$i]);
} unset($i);

Expand Down
2 changes: 1 addition & 1 deletion framework/Koch/Router/TargetRoute.php
Expand Up @@ -114,7 +114,7 @@ public static function getController()
{
// the default "controller" name is the "module" name
// this is the case if a route "/:module" is used
if(isset(self::$parameters['controller']) === false) {
if (isset(self::$parameters['controller']) === false) {
self::$parameters['controller'] = self::$parameters['module'];
}

Expand Down
7 changes: 3 additions & 4 deletions framework/Koch/View/Renderer/Php.php
Expand Up @@ -58,7 +58,6 @@ public function fetch($filename = null, array $data = array())
$file = $this->file;
}


/**
* extract all template variables to local scope,
* but do not overwrite an existing variable.
Expand All @@ -72,12 +71,12 @@ public function fetch($filename = null, array $data = array())
include $file; // conditional include; not require !
} catch (\Exception $e) {
// clean buffer before throwing exception
ob_get_clean();
ob_get_clean();
throw $e;
// throw new Koch_Excpetion('PHP Renderer Error: Template ' . $file . ' not found!', 99);
}
}

return ob_get_clean();
return ob_get_clean();
}

/**
Expand Down

0 comments on commit 7f0ef9c

Please sign in to comment.