Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (37 sloc) 0.635 kB
<?php
namespace FOQ\TyperBundle;
/**
* Trims code
*/
class CodeTrimmer
{
/**
* The code to trim
*
* @var string
*/
protected $code = null;
/**
* Instanciates a new CodeTrimmer
*
* @param string code
*/
public function __construct($code)
{
$this->code = $code;
}
/**
* Trim the code
*
* @return string
**/
public function trim()
{
$loc = explode("\n", $this->code);
foreach ($loc as $i => $l) {
$loc[$i] = rtrim($l);
}
$code = implode("\n", $loc);
return $code;
}
}
Jump to Line
Something went wrong with that request. Please try again.