DataTableManipulator
1 month ago
ApiRenderer.php
3 months ago
CORSHandler.php
1 year ago
DataTableGenericFilter.php
1 month ago
DataTableManipulator.php
1 month ago
DataTablePostProcessor.php
1 month ago
DocumentationGenerator.php
6 months ago
Inconsistencies.php
2 years ago
NoDefaultValue.php
2 years ago
Proxy.php
1 month ago
Request.php
1 month ago
ResponseBuilder.php
1 month ago
Inconsistencies.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\API; |
| 10 | |
| 11 | /** |
| 12 | * Contains logic to replicate inconsistencies in Piwik's API. This class exists |
| 13 | * to provide a way to clean up existing Piwik code and behavior without breaking |
| 14 | * backwards compatibility immediately. |
| 15 | * |
| 16 | * Code that handles the case when the 'format_metrics' query parameter value is |
| 17 | * 'bc' should be removed as well. This code is in API\Request and DataTablePostProcessor. |
| 18 | * |
| 19 | * Should be removed before releasing Piwik 3.0. |
| 20 | */ |
| 21 | class Inconsistencies |
| 22 | { |
| 23 | /** |
| 24 | * In Piwik 2.X and below, the "raw" API would format percent values but no others. |
| 25 | * This method returns the list of percent metrics that were returned from the API |
| 26 | * formatted so we can maintain BC. |
| 27 | * |
| 28 | * Used by DataTablePostProcessor. |
| 29 | */ |
| 30 | public function getPercentMetricsToFormat() |
| 31 | { |
| 32 | return array('bounce_rate', 'conversion_rate', 'abandoned_rate', 'interaction_rate', 'exit_rate', 'bounce_rate_returning', 'nb_visits_percentage', '/.*_evolution/', '/step_.*_rate/', '/funnel_.*_rate/', '/form_.*_rate/', '/field_.*_rate/', '/Referrers.*_percent/'); |
| 33 | } |
| 34 | } |
| 35 |