mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expanded reports.
This commit is contained in:
55
app/lib/FireflyIII/Report/ReportHelperInterface.php
Normal file
55
app/lib/FireflyIII/Report/ReportHelperInterface.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Report;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Interface ReportHelperInterface
|
||||
*
|
||||
* @package FireflyIII\Report
|
||||
*/
|
||||
interface ReportHelperInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Only return the top X entries, group the rest by amount
|
||||
* and described as 'Others'. id = 0 as well
|
||||
*
|
||||
* @param array $array
|
||||
* @param int $limit
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function limitArray(array $array, $limit = 10);
|
||||
|
||||
/**
|
||||
* Turns a collection into an array. Needs the field 'id' for the key,
|
||||
* and saves 'name', 'amount','spent' (if present) as a subarray.
|
||||
*
|
||||
* @param Collection $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function makeArray(Collection $collection);
|
||||
|
||||
/**
|
||||
* Merges two of the arrays as defined above. Can't handle more (yet)
|
||||
*
|
||||
* @param array $one
|
||||
* @param array $two
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function mergeArrays(array $one, array $two);
|
||||
|
||||
/**
|
||||
* Sort an array where all 'amount' keys are negative floats.
|
||||
*
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sortNegativeArray(array $array);
|
||||
|
||||
}
|
Reference in New Issue
Block a user