Permalink
Browse files

(php) Kata resolved. Cleaning code.

  • Loading branch information...
rmhdev committed Dec 31, 2011
1 parent 948fd4f commit 796c64a0222192da3fa4b12cd2f4f39238a67f18
Showing with 6 additions and 2 deletions.
  1. +6 −2 rmhdev/php/StringCalculator.php
@@ -71,7 +71,9 @@ protected function explodeStringInArrayOfIntegers(){
protected function extractStringOnlyWithNumbersAndFinalDelimiter(){
$stringAfterDelimiterCode = $this->getStringAfterDelimiterCode();
- $onlyNumbersAndFinalDelimiter = str_replace($this->getDelimiters(), $this->getFinalDelimiter(), $stringAfterDelimiterCode);
+ $onlyNumbersAndFinalDelimiter = str_replace(
+ $this->getDelimiters(), $this->getFinalDelimiter(), $stringAfterDelimiterCode
+ );
return $this->replaceNewLinesWithFinalDelimiter($onlyNumbersAndFinalDelimiter);
}
@@ -80,7 +82,9 @@ protected function replaceNewLinesWithFinalDelimiter($string){
}
protected function getStringAfterDelimiterCode(){
- return $this->stringHasDelimiterCode() ? substr($this->getString(), $this->lengthOfDelimiterCodeInString()) : $this->getString();
+ return $this->stringHasDelimiterCode() ?
+ substr($this->getString(), $this->lengthOfDelimiterCodeInString()) :
+ $this->getString();
}
protected function lengthOfDelimiterCodeInString(){

0 comments on commit 796c64a

Please sign in to comment.