Thiemo Mättig (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/253914
Change subject: Inject StatementSectionsView instead of StatementGroupListView
......................................................................
Inject StatementSectionsView instead of StatementGroupListView
Bug: 253912
Change-Id: I091db04f4925f3989c994719035ef1fc731773c0
---
M view/src/EntityViewFactory.php
M view/src/ItemView.php
M view/src/PropertyView.php
M view/tests/phpunit/ItemViewTest.php
M view/tests/phpunit/PropertyViewTest.php
5 files changed, 16 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/14/253914/1
diff --git a/view/src/EntityViewFactory.php b/view/src/EntityViewFactory.php
index cdc2ab1..d0e5652 100644
--- a/view/src/EntityViewFactory.php
+++ b/view/src/EntityViewFactory.php
@@ -154,9 +154,8 @@
LanguageFallbackChain $fallbackChain,
EditSectionGenerator $editSectionGenerator
) {
-
$entityTermsView = $this->newEntityTermsView( $languageCode,
$editSectionGenerator );
- $statementGroupListView = $this->newStatementGroupListView(
+ $statementSectionsView = $this->newStatementSectionsView(
$languageCode,
$fallbackChain,
$labelDescriptionLookup,
@@ -182,7 +181,7 @@
return new ItemView(
$this->templateFactory,
$entityTermsView,
- $statementGroupListView,
+ $statementSectionsView,
$language,
$siteLinksView,
$this->siteLinkGroups
@@ -191,7 +190,7 @@
return new PropertyView(
$this->templateFactory,
$entityTermsView,
- $statementGroupListView,
+ $statementSectionsView,
$this->dataTypeFactory,
$language
);
@@ -206,9 +205,9 @@
* @param LabelDescriptionLookup $labelDescriptionLookup
* @param EditSectionGenerator $editSectionGenerator
*
- * @return StatementGroupListView
+ * @return StatementSectionsView
*/
- private function newStatementGroupListView(
+ private function newStatementSectionsView(
$languageCode,
LanguageFallbackChain $fallbackChain,
LabelDescriptionLookup $labelDescriptionLookup,
@@ -227,12 +226,14 @@
$snakHtmlGenerator
);
- return new StatementGroupListView(
+ $statementGroupListView = new StatementGroupListView(
$this->templateFactory,
$propertyIdFormatter,
$editSectionGenerator,
$claimHtmlGenerator
);
+
+ return new StatementSectionsView( $this->templateFactory,
$statementGroupListView );
}
/**
diff --git a/view/src/ItemView.php b/view/src/ItemView.php
index 07ac4d0..7ddefaf 100644
--- a/view/src/ItemView.php
+++ b/view/src/ItemView.php
@@ -40,7 +40,7 @@
*
* @param TemplateFactory $templateFactory
* @param EntityTermsView $entityTermsView
- * @param StatementGroupListView $statementGroupListView
+ * @param StatementSectionsView $statementSectionsView
* @param Language $language
* @param SiteLinksView $siteLinksView
* @param string[] $siteLinkGroups
@@ -48,18 +48,14 @@
public function __construct(
TemplateFactory $templateFactory,
EntityTermsView $entityTermsView,
- StatementGroupListView $statementGroupListView,
+ StatementSectionsView $statementSectionsView,
Language $language,
SiteLinksView $siteLinksView,
array $siteLinkGroups
) {
parent::__construct( $templateFactory, $entityTermsView,
$language );
- // TODO: Inject.
- $this->statementSectionsView = new StatementSectionsView(
- $this->templateFactory,
- $statementGroupListView
- );
+ $this->statementSectionsView = $statementSectionsView;
$this->siteLinkGroups = $siteLinkGroups;
$this->siteLinksView = $siteLinksView;
}
diff --git a/view/src/PropertyView.php b/view/src/PropertyView.php
index 694dc18..065ee70 100644
--- a/view/src/PropertyView.php
+++ b/view/src/PropertyView.php
@@ -35,24 +35,20 @@
/**
* @param TemplateFactory $templateFactory
* @param EntityTermsView $entityTermsView
- * @param StatementGroupListView $statementGroupListView
+ * @param StatementSectionsView $statementSectionsView
* @param DataTypeFactory $dataTypeFactory
* @param Language $language
*/
public function __construct(
TemplateFactory $templateFactory,
EntityTermsView $entityTermsView,
- StatementGroupListView $statementGroupListView,
+ StatementSectionsView $statementSectionsView,
DataTypeFactory $dataTypeFactory,
Language $language
) {
parent::__construct( $templateFactory, $entityTermsView,
$language );
- // TODO: Inject.
- $this->statementSectionsView = new StatementSectionsView(
- $this->templateFactory,
- $statementGroupListView
- );
+ $this->statementSectionsView = $statementSectionsView;
$this->dataTypeFactory = $dataTypeFactory;
}
diff --git a/view/tests/phpunit/ItemViewTest.php
b/view/tests/phpunit/ItemViewTest.php
index 9eb41cd..2ba7bc6 100644
--- a/view/tests/phpunit/ItemViewTest.php
+++ b/view/tests/phpunit/ItemViewTest.php
@@ -55,7 +55,7 @@
$this->getMockBuilder( 'Wikibase\View\EntityTermsView' )
->disableOriginalConstructor()
->getMock(),
- $this->getMockBuilder(
'Wikibase\View\StatementGroupListView' )
+ $this->getMockBuilder(
'Wikibase\View\StatementSectionsView' )
->disableOriginalConstructor()
->getMock(),
$this->getMock( 'Language' ),
diff --git a/view/tests/phpunit/PropertyViewTest.php
b/view/tests/phpunit/PropertyViewTest.php
index fea34cc..20cabe8 100644
--- a/view/tests/phpunit/PropertyViewTest.php
+++ b/view/tests/phpunit/PropertyViewTest.php
@@ -78,7 +78,7 @@
$this->getMockBuilder( 'Wikibase\View\EntityTermsView' )
->disableOriginalConstructor()
->getMock(),
- $this->getMockBuilder(
'Wikibase\View\StatementGroupListView' )
+ $this->getMockBuilder(
'Wikibase\View\StatementSectionsView' )
->disableOriginalConstructor()
->getMock(),
$this->getDataTypeFactory(),
--
To view, visit https://gerrit.wikimedia.org/r/253914
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I091db04f4925f3989c994719035ef1fc731773c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits