Complexity cleanup [skip ci]

This commit is contained in:
James Cole
2014-12-31 16:45:12 +01:00
parent 8ec8042045
commit 6fa73ee28d
10 changed files with 92 additions and 104 deletions

View File

@@ -2,6 +2,7 @@
namespace FireflyIII\Shared\Toolkit;
use Carbon\Carbon;
use FireflyIII\Exception\FireflyException;
/**
@@ -12,14 +13,14 @@ use FireflyIII\Exception\FireflyException;
class Date
{
/**
* @param \Carbon\Carbon $theDate
* @param Carbon $theDate
* @param $repeatFreq
* @param $skip
*
* @return \Carbon\Carbon
* @throws FireflyException
*/
public function addPeriod(\Carbon\Carbon $theDate, $repeatFreq, $skip)
public function addPeriod(Carbon $theDate, $repeatFreq, $skip)
{
$date = clone $theDate;
$add = ($skip + 1);
@@ -58,13 +59,13 @@ class Date
}
/**
* @param \Carbon\Carbon $theCurrentEnd
* @param Carbon $theCurrentEnd
* @param $repeatFreq
*
* @return \Carbon\Carbon
* @return Carbon
* @throws FireflyException
*/
public function endOfPeriod(\Carbon\Carbon $theCurrentEnd, $repeatFreq)
public function endOfPeriod(Carbon $theCurrentEnd, $repeatFreq)
{
$currentEnd = clone $theCurrentEnd;
switch ($repeatFreq) {
@@ -99,14 +100,14 @@ class Date
}
/**
* @param \Carbon\Carbon $theCurrentEnd
* @param Carbon $theCurrentEnd
* @param $repeatFreq
* @param \Carbon\Carbon $maxDate
* @param Carbon $maxDate
*
* @return \Carbon\Carbon
* @return Carbon
* @throws FireflyException
*/
public function endOfX(\Carbon\Carbon $theCurrentEnd, $repeatFreq, \Carbon\Carbon $maxDate)
public function endOfX(Carbon $theCurrentEnd, $repeatFreq, Carbon $maxDate)
{
$currentEnd = clone $theCurrentEnd;
switch ($repeatFreq) {
@@ -148,13 +149,13 @@ class Date
}
/**
* @param \Carbon\Carbon $date
* @param Carbon $date
* @param $repeatFrequency
*
* @return string
* @throws FireflyException
*/
public function periodShow(\Carbon\Carbon $date, $repeatFrequency)
public function periodShow(Carbon $date, $repeatFrequency)
{
switch ($repeatFrequency) {
default:
@@ -182,13 +183,13 @@ class Date
}
/**
* @param \Carbon\Carbon $theDate
* @param Carbon $theDate
* @param $repeatFreq
*
* @return \Carbon\Carbon
* @return Carbon
* @throws FireflyException
*/
public function startOfPeriod(\Carbon\Carbon $theDate, $repeatFreq)
public function startOfPeriod(Carbon $theDate, $repeatFreq)
{
$date = clone $theDate;
switch ($repeatFreq) {
@@ -227,14 +228,14 @@ class Date
}
/**
* @param \Carbon\Carbon $theDate
* @param Carbon $theDate
* @param $repeatFreq
* @param int $subtract
*
* @return \Carbon\Carbon
* @return Carbon
* @throws FireflyException
*/
public function subtractPeriod(\Carbon\Carbon $theDate, $repeatFreq, $subtract = 1)
public function subtractPeriod(Carbon $theDate, $repeatFreq, $subtract = 1)
{
$date = clone $theDate;
switch ($repeatFreq) {