for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ajax\common\html;
use Ajax\service\JArray;
class PropertyWrapper {
public static function wrap($input, $js=NULL, $separator=' ', $valueQuote='"') {
$separator
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$valueQuote
$output="";
if (is_string($input)) {
$output=$input;
}
if (is_array($input)) {
if (sizeof($input)>0) {
$value1=reset($input);
if (is_object($value1)) {
$output=PropertyWrapper::wrapObjects($input, $js, $separator=' ');
} else
$output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"');
return $output;
public static function wrapStrings($input, $separator=' ', $valueQuote='"') {
if (JArray::isAssociative($input)===true) {
$result=implode($separator, array_map(function ($v, $k) use($valueQuote) {
return $k.'='.$valueQuote.$v.$valueQuote;
}, $input, array_keys($input)));
} else {
$result=implode($separator, array_values($input));
return $result;
public static function wrapObjects($input, $js=NULL, $separator=' ') {
return implode($separator, array_map(function ($v) use($js) {
if (is_object($v))
return $v->compile($js);
else
return $v;
}, $input));
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.