From 0bad2275480bf19f11b7093ea8711de9a6bb81ac Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 5 Feb 2016 09:30:06 +0100 Subject: [PATCH] No more PHP 5.6 tests. --- .travis.yml | 1 - app/Repositories/Budget/BudgetRepository.php | 2 +- .../Budget/BudgetRepositoryInterface.php | 2 +- app/Support/ExpandedForm.php | 16 ++++++++-------- app/Support/Navigation.php | 19 ++++++++++--------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index abfb2812b8..9a8d6aca69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ sudo: false php: - - 5.6 - 7 install: diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index c789390f05..19ca4c5ec5 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -443,7 +443,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return LengthAwarePaginator */ - public function getJournals(Budget $budget, LimitRepetition $repetition, int $take) + public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50) { $offset = intval(Input::get('page')) > 0 ? intval(Input::get('page')) * $take : 0; $setQuery = $budget->transactionJournals()->withRelevantData()->take($take)->offset($offset) diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 67ba9bf499..ac530f81c3 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -168,7 +168,7 @@ interface BudgetRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournals(Budget $budget, LimitRepetition $repetition, int $take); + public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50); /** * @param Carbon $start diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 62eec09fb4..8c82ca64a6 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -291,7 +291,7 @@ class ExpandedForm * * @return string */ - public function staticText($name, $value, array $options = []) + public function staticText(string $name, $value, array $options = []) { $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); @@ -310,7 +310,7 @@ class ExpandedForm * * @return string */ - public function tags($name, $value = null, array $options = []) + public function tags(string $name, $value = null, array $options = []) { $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); @@ -329,7 +329,7 @@ class ExpandedForm * * @return string */ - public function text($name, $value = null, array $options = []) + public function text(string $name, $value = null, array $options = []) { $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); @@ -348,7 +348,7 @@ class ExpandedForm * * @return string */ - public function textarea($name, $value = null, array $options = []) + public function textarea(string $name, $value = null, array $options = []) { $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); @@ -368,7 +368,7 @@ class ExpandedForm * * @return array */ - protected function expandOptionArray($name, $label, array $options) + protected function expandOptionArray(string $name, $label, array $options) { $options['class'] = 'form-control'; $options['id'] = 'ffInput_' . $name; @@ -384,7 +384,7 @@ class ExpandedForm * * @return mixed */ - protected function fillFieldValue($name, $value) + protected function fillFieldValue(string $name, $value) { if (Session::has('preFilled')) { $preFilled = session('preFilled'); @@ -409,7 +409,7 @@ class ExpandedForm * * @return string */ - protected function getHolderClasses($name) + protected function getHolderClasses(string $name) { /* * Get errors from session: @@ -431,7 +431,7 @@ class ExpandedForm * * @return mixed */ - protected function label($name, $options) + protected function label(string $name, array $options) { if (isset($options['label'])) { return $options['label']; diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index fe83828573..721a84507c 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -22,7 +22,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function addPeriod(Carbon $theDate, $repeatFreq, $skip) + public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip) { $date = clone $theDate; $add = ($skip + 1); @@ -61,7 +61,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function endOfPeriod(Carbon $theCurrentEnd, $repeatFreq) + public function endOfPeriod(Carbon $theCurrentEnd, string $repeatFreq) { $currentEnd = clone $theCurrentEnd; @@ -120,7 +120,7 @@ class Navigation * * @return \Carbon\Carbon */ - public function endOfX(Carbon $theCurrentEnd, $repeatFreq, Carbon $maxDate = null) + public function endOfX(Carbon $theCurrentEnd, string $repeatFreq, Carbon $maxDate = null) { $functionMap = [ '1D' => 'endOfDay', @@ -161,7 +161,7 @@ class Navigation * @return string * @throws FireflyException */ - public function periodShow(Carbon $date, $repeatFrequency) + public function periodShow(Carbon $date, string $repeatFrequency) { $formatMap = [ '1D' => '%e %B %Y', @@ -196,7 +196,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function startOfPeriod(Carbon $theDate, $repeatFreq) + public function startOfPeriod(Carbon $theDate, string $repeatFreq) { $date = clone $theDate; @@ -247,7 +247,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function subtractPeriod(Carbon $theDate, $repeatFreq, $subtract = 1) + public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = 1) { $date = clone $theDate; // 1D 1W 1M 3M 6M 1Y @@ -286,13 +286,14 @@ class Navigation // a custom range requires the session start // and session end to calculate the difference in days. // this is then subtracted from $theDate (* $subtract). - if($repeatFreq === 'custom') { + if ($repeatFreq === 'custom') { /** @var Carbon $tStart */ $tStart = session('start', Carbon::now()->startOfMonth()); /** @var Carbon $tEnd */ $tEnd = session('end', Carbon::now()->endOfMonth()); $diffInDays = $tStart->diffInDays($tEnd); $date->subDays($diffInDays * $subtract); + return $date; } @@ -306,7 +307,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function updateEndDate($range, Carbon $start) + public function updateEndDate(string $range, Carbon $start) { $functionMap = [ '1D' => 'endOfDay', @@ -342,7 +343,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function updateStartDate($range, Carbon $start) + public function updateStartDate(string $range, Carbon $start) { $functionMap = [ '1D' => 'startOfDay',