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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-02-02 06:16:08 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-02-02 06:16:08 +0300
commit344b0fce2ca0e6d5634546b071526c2322bd878f (patch)
tree40a8a224e2c7ab97d4537cf817fe6f8a817165e4 /core/Period.php
parent03ea8fb3ec54285bdd63cdada015aa67aec1c6ee (diff)
Replaced calls of static methods with dependency injection
Diffstat (limited to 'core/Period.php')
-rw-r--r--core/Period.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/Period.php b/core/Period.php
index eb3c0fda89..d4044ed68e 100644
--- a/core/Period.php
+++ b/core/Period.php
@@ -8,8 +8,10 @@
*/
namespace Piwik;
+use Piwik\Container\StaticContainer;
use Piwik\Period\Factory as PeriodFactory;
use Piwik\Period\Range;
+use Piwik\Translation\Translator;
/**
* Date range representation.
@@ -30,7 +32,7 @@ abstract class Period
{
/**
* Array of subperiods
- * @var \Piwik\Period[]
+ * @var Period[]
*/
protected $subperiods = array();
protected $subperiodsProcessed = false;
@@ -46,6 +48,11 @@ abstract class Period
protected $date = null;
/**
+ * @var Translator
+ */
+ protected $translator;
+
+ /**
* Constructor.
*
* @param Date $date
@@ -54,6 +61,8 @@ abstract class Period
public function __construct(Date $date)
{
$this->date = clone $date;
+
+ $this->translator = StaticContainer::get('Piwik\Translation\Translator');
}
/**