Skip to content

Commit

Permalink
Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
qstudio committed Aug 14, 2020
1 parent 5156e45 commit 458ec83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library/parse/php_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public static function format( $match = null, $process = 'internal' ){
){

// h::log( self::$return );
h::log( 'Return from "'.self::$function.'" is in an array format, trying to convert array values to string' );
h::log( 'Return from "'.$open.' '.self::$function.' '.$close.'" is in an array format, trying to convert array values to string' );

self::$return = implode ( " ", array_values( self::$return ) );
self::$return = trim( self::$return );
Expand Down
5 changes: 4 additions & 1 deletion library/render/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ public static function define( $args = null ){

}

/*
// REMOVED - as clashes with default value assignment in markup::prepare();
} else {
// h::log( 'e:>Error in $args ( empty or not an array ) by "'.\q\core\method::backtrace([ 'level' => 5, 'return' => 'class_function' ]).'"' );
h::log( 'e:>Error in $args ( empty or not an array ) by "'.\q\core\method::backtrace([ 'level' => 5, 'return' => 'class_function' ]).'"' );
// h::log( $args );
// return false;
Expand All @@ -196,6 +198,7 @@ public static function define( $args = null ){
return false;
}
*/

}

Expand Down
8 changes: 5 additions & 3 deletions library/render/markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function prepare(){
}

// test ##
// helper::log( self::$fields );
// h::log( self::$fields );
// h::log( self::$markup );

// pre-format markup to extract comments ##
Expand Down Expand Up @@ -79,6 +79,8 @@ public static function prepare(){
// loop over each field, replacing variables with values ##
foreach( self::$fields as $key => $value ) {

// h::log( '$value: '.$value );

// cast booleans to integer ##
if ( \is_bool( $value ) ) {

Expand All @@ -93,7 +95,7 @@ public static function prepare(){
&& ! \is_int( $value )
) {

h::log( 'e:>The value of "'.$key.'" is not a string or integer - so cannot be rendered, we will check for a default value...' );
h::log( 'd:>The value of "'.self::$args['context'].'->'.self::$args['task'].'->'.$key.'" is not a string or integer... checking for a default value' );

if(
isset( self::$args['config']['default'] )
Expand Down Expand Up @@ -134,7 +136,7 @@ public static function prepare(){

}

h::log( 'd:>Default value set: '.$default_value );
h::log( 'd:>Default value for "'.self::$args['context'].'->'.self::$args['task'].'->'.$key.'" set to "'.$default_value.'"' );

// set value and continue ##
$value = $default_value;
Expand Down

0 comments on commit 458ec83

Please sign in to comment.