for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) 2016 ublaboo <[email protected]>
* @author Pavel Janda <[email protected]>
* @package Ublaboo
*/
namespace Ublaboo\ApiDocu;
class TemplateFilters
{
public static function common($filter, $value)
$value
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
if (method_exists(__CLASS__, $filter)) {
$args = func_get_args();
array_shift($args);
return call_user_func_array([__CLASS__, $filter], $args);
}
public static function description($text)
$text = nl2br($text);
$text = str_replace(["\n", "\n\r", "\r\n", "\r"], '', $text);
$text = preg_replace_callback('/<json><br \/>(.*?)<\/json>/s', function($item) {
$s = '<br><pre class="apiDocu-json">' . str_replace("<br>", '', end($item)) . '</pre>';
$s = preg_replace('/(\s)"([^"]+)"/', '$1<span class="apiDocu-string">"$2"</span>', $s);
$s = preg_replace('/\/\/(.*?)<br \/>/', '<span class="apiDocu-comment">//$1</span><br>', $s);
return $s;
}, $text);
$text = preg_replace('/\*\*([^*]*)\*\*/', '<strong>$1</strong>', $text);
return $text;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.