diff options
author | diosmosis <benaka@piwik.pro> | 2015-02-10 00:21:15 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-02-10 00:21:15 +0300 |
commit | 6ef32c1260050c7b4ec04009a8ebd219c6b44a53 (patch) | |
tree | 8a73e99f7e5c0e5999c2f067621f6c75185f3c52 /plugins | |
parent | e084b065d0b8abd8684fb74be4d1e0e66db33f74 (diff) |
Refs #7112, shortening constructor logic for DuplicateActionRemover & FixDuplicateActions.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php | 23 | ||||
-rw-r--r-- | plugins/CoreAdminHome/Model/DuplicateActionRemover.php | 11 |
2 files changed, 6 insertions, 28 deletions
diff --git a/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php b/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php index 54b53afabe..47a058c7ad 100644 --- a/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php +++ b/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php @@ -75,25 +75,10 @@ class FixDuplicateLogActions extends ConsoleCommand { parent::__construct(); - if ($invalidator === null) { - $invalidator = new ArchiveInvalidator(); - } - $this->archiveInvalidator = $invalidator; - - if ($duplicateActionRemover === null) { - $duplicateActionRemover = new DuplicateActionRemover(); - } - $this->duplicateActionRemover = $duplicateActionRemover; - - if ($actionsAccess === null) { - $actionsAccess = new Actions(); - } - $this->actionsAccess = $actionsAccess; - - if ($logger === null) { - $logger = StaticContainer::get('Psr\Log\LoggerInterface'); - } - $this->logger = $logger; + $this->archiveInvalidator = $invalidator ?: new ArchiveInvalidator(); + $this->duplicateActionRemover = $duplicateActionRemover ?: new DuplicateActionRemover(); + $this->actionsAccess = $actionsAccess ?: new Actions(); + $this->logger = $logger ?: StaticContainer::get('Psr\Log\LoggerInterface'); } protected function configure() diff --git a/plugins/CoreAdminHome/Model/DuplicateActionRemover.php b/plugins/CoreAdminHome/Model/DuplicateActionRemover.php index 03cc529284..21a5613616 100644 --- a/plugins/CoreAdminHome/Model/DuplicateActionRemover.php +++ b/plugins/CoreAdminHome/Model/DuplicateActionRemover.php @@ -58,15 +58,8 @@ class DuplicateActionRemover */ public function __construct($tableMetadataAccess = null, $logger = null) { - if ($tableMetadataAccess === null) { - $tableMetadataAccess = new TableMetadata(); - } - $this->tableMetadataAccess = $tableMetadataAccess; - - if ($logger === null) { - $logger = StaticContainer::get('Psr\Log\LoggerInterface'); - } - $this->logger = $logger; + $this->tableMetadataAccess = $tableMetadataAccess ?: new TableMetadata(); + $this->logger = $logger ?: StaticContainer::get('Psr\Log\LoggerInterface'); } /** |