Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-09-07 23:01:22 +0300
committerdiosmosis <benaka@piwik.pro>2015-09-07 23:01:22 +0300
commita4e3e6f0a59633c7416f5528a34775981a842c56 (patch)
tree33479d7f13f9b123d6999773eaac9af1a971a037 /plugins/BulkTracking/Tracker
parentd6382a8aca1820f65c4f37930f895fa6e13afda0 (diff)
Quick refactor to BulkTracking Response.
Diffstat (limited to 'plugins/BulkTracking/Tracker')
-rw-r--r--plugins/BulkTracking/Tracker/Response.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/BulkTracking/Tracker/Response.php b/plugins/BulkTracking/Tracker/Response.php
index 1580f1dbce..e8d3667eec 100644
--- a/plugins/BulkTracking/Tracker/Response.php
+++ b/plugins/BulkTracking/Tracker/Response.php
@@ -69,9 +69,7 @@ class Response extends Tracker\Response
'invalid' => count($this->invalidRequests),
);
- if ($this->isAuthenticated) {
- $result['invalid_indices'] = $this->invalidRequests;
- }
+ $this->addInvalidIndicesIfAuthenticated($result);
// send error when in debug mode
if ($tracker->isDebugModeEnabled()) {
@@ -89,9 +87,7 @@ class Response extends Tracker\Response
'invalid' => count($this->invalidRequests),
);
- if ($this->isAuthenticated) {
- $result['invalid_indices'] = $this->invalidRequests;
- }
+ $this->addInvalidIndicesIfAuthenticated($result);
return $result;
}
@@ -105,4 +101,11 @@ class Response extends Tracker\Response
{
$this->isAuthenticated = $isAuthenticated;
}
+
+ private function addInvalidIndicesIfAuthenticated(&$result)
+ {
+ if ($this->isAuthenticated) {
+ $result['invalid_indices'] = $this->invalidRequests;
+ }
+ }
}