Improve code quality and add documentation in folder "Generator"

This commit is contained in:
James Cole
2018-07-07 07:18:49 +02:00
parent 8692590600
commit a1056147d8
23 changed files with 249 additions and 51 deletions

View File

@@ -18,6 +18,8 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** @noinspection PhpUndefinedMethodInspection */
/** @noinspection PhpUndefinedMethodInspection */
declare(strict_types=1);
namespace FireflyIII\Generator\Report;
@@ -31,6 +33,8 @@ use Illuminate\Support\Collection;
class Support
{
/**
* Get the top expenses.
*
* @return Collection
*/
public function getTopExpenses(): Collection
@@ -39,6 +43,8 @@ class Support
}
/**
* Get the top income.
*
* @return Collection
*/
public function getTopIncome(): Collection
@@ -47,6 +53,8 @@ class Support
}
/**
* Get averages from a collection.
*
* @param Collection $collection
* @param int $sortFlag
*
@@ -89,6 +97,8 @@ class Support
}
/**
* Summarize collection by earned and spent data.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
*
* @param array $spent
@@ -117,7 +127,6 @@ class Support
$return[$objectId]['spent'] = $entry;
$return['sum']['spent'] = bcadd($return['sum']['spent'], $entry);
}
unset($entry);
/**
* @var int
@@ -136,6 +145,8 @@ class Support
}
/**
* Summarize the data by account.
*
* @param Collection $collection
*
* @return array