コードのサンプルを貼付けてみたり、gistを貼付けてみたりした。

PHP code sample

code-sample.php
<?php
namespace Satooshi;
/**
* Short description.
*
* Long description.
*/
class Test
{
const CLASS_CONSTANT = 'class constant';
public $prop;
public static $staticProp;
/**
* Constructor.
*/
public function __construct()
{
$this->prop = 'property';
}
/**
* Set prop.
*
* @param string $prop
* @return void
*/
public function setProp($prop)
{
$this->prop = $prop;
}
/**
* Return prop.
*
* @return string
*/
public function getProp()
{
return $this->prop;
}
public function hello()
{
// say hello
$message = 'hello';
echo $message;
// say bye
$message = "bye";
echo $bye;
}
}

gist sample

blog-sample.phplink
<?php
namespace Satooshi;
/**
* Short description.
*
* Long description.
*/
class Test
{
const CLASS_CONSTANT = 'class constant';
public $prop;
public static $staticProp;
/**
* Constructor.
*/
public function __construct()
{
$this->prop = 'property';
}
/**
* Set prop.
*
* @param string $prop
* @return void
*/
public function setProp($prop)
{
$this->prop = $prop;
}
/**
* Return prop.
*
* @return string
*/
public function getProp()
{
return $this->prop;
}
public function hello()
{
// say hello
$message = 'hello';
echo $message;
// say bye
$message = "bye";
echo $bye;
}
}
junit.phplink
<?php
function run($path)
{
$xml = simplexml_load_file($path);
$project = $xml->testsuite;
echo sprintf("total: %s msec", formatMsec($project['time'])) . PHP_EOL;
foreach ($project->testsuite as $testsuite) {
echo sprintf(" suite: %s msec : %s", formatMsec($testsuite['time']), $testsuite['name']) . PHP_EOL;
foreach ($testsuite->testcase as $testcase) {
echo sprintf(" case: %s msec : %s", printMsec($testcase['time']), $testcase['name']) . PHP_EOL;
}
}
return 0;
}
function msec($str)
{
return floatval((string)$str) * 1000;
}
function formatMsec($time)
{
return sprintf('%9.3f', msec($time));
}
function printMsec($time, $warn = 5, $error = 10)
{
$str = formatMsec($time);
if (!class_exists('ColorCLI')) {
return $str;
}
$msec = msec($time);
if ($msec < $warn) {
return ColorCLI::lightGreen($str);
} elseif ($msec < $error) {
return ColorCLI::yellow($str);
}
return ColorCLI::red($str);
}
$colorCli = realpath(__DIR__ . '/ColorCLI.php');
if (file_exists($colorCli)) {
include_once $colorCli;
}
$xmlFileName = "junit.xml";
$root = realpath(__DIR__ . "/..");
$path = realpath("$root/build/logs/$xmlFileName");
if ($path === false || !file_exists($path)) {
die("Not found $xmlFileName");
}
return run($path);