Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SemanticCite.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use SCI\HookRegistry;
use SCI\Options;
use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;

/**
* @see https://github.com/SemanticMediaWiki/SemanticCite/
Expand Down
8 changes: 5 additions & 3 deletions src/CitationResourceMatchFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
use SMW\Query\PrintRequest;
use SMW\Store;
use SMW\DIProperty;
use SMWPropertyValue as PropertyValue;
use SMW\DataValues\PropertyValue;
use SMWQuery as Query;
use SMWDIBlob as DIBlob;
use SMW\DataValueFactory;
use SMW\Query\QueryResult;
use SMWInfolink;
use SCI\DataValues\ResourceIdentifierFactory;

/**
Expand Down Expand Up @@ -60,7 +62,7 @@ public function findCitationResourceLinks( array $subjects, $linkClass = '', $ca
null
);

$browselink = \SMWInfolink::newBrowsingLink(
$browselink = SMWInfolink::newBrowsingLink(
$caption,
$dataValue->getWikiValue(),
$linkClass
Expand Down Expand Up @@ -135,7 +137,7 @@ public function findCitationTextFor( $citationReference ) {
$citationReference
);

if ( !$queryResult instanceof \SMWQueryResult ) {
if ( !$queryResult instanceof QueryResult ) {
return [ $subjects, $text ];
}

Expand Down
10 changes: 5 additions & 5 deletions src/CitationTextChangeUpdateJobDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use SMW\Store;
use SMW\DIProperty;
use SMW\DIWikiPage;
use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;
use SMW\HashBuilder;
use SMW\SQLStore\CompositePropertyTableDiffIterator;
use SMW\SQLStore\ChangeOp\ChangeOp;

/**
* If a citation text was altered then lookup related references on pages used
Expand Down Expand Up @@ -59,11 +59,11 @@ public function setEnabledUpdateJobState( $enabledUpdateJobState ) {
* @since 1.0
*
* @param DIWikiPage $subject
* @param CompositePropertyTableDiffIterator $compositePropertyTableDiffIterator
* @param ChangeOp $changeOp
*
* @return boolean
*/
public function dispatchUpdateJobFor( DIWikiPage $subject, CompositePropertyTableDiffIterator $compositePropertyTableDiffIterator ) {
public function dispatchUpdateJobFor( DIWikiPage $subject, ChangeOp $changeOp ) {

if ( !$this->enabledUpdateJobState ) {
return false;
Expand All @@ -74,7 +74,7 @@ public function dispatchUpdateJobFor( DIWikiPage $subject, CompositePropertyTabl
);

$subjectIdList = $this->getSubjectListFrom(
$compositePropertyTableDiffIterator->getOrderedDiffByTable( $tableName )
$changeOp->getOrderedDiffByTable( $tableName )
);

if ( ( $jobList = $this->getDispatchableTargetList( $subjectIdList ) ) === [] ) {
Expand Down
2 changes: 1 addition & 1 deletion src/DataValues/CitationReferenceValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SCI\DataValues;

use SCI\CitationReferencePositionJournal;
use SMWStringValue as StringValue;
use SMW\DataValues\StringValue;
use SMWDIBlob as DIBlob;
use Html;

Expand Down
2 changes: 1 addition & 1 deletion src/DataValues/ResourceIdentifierStringValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SCI\DataValues;

use SMWStringValue as StringValue;
use SMW\DataValues\StringValue;
use SMWDIBlob as DIBlob;
use Html;

Expand Down
2 changes: 1 addition & 1 deletion src/HookRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SMW\Store;
use Onoi\Cache\Cache;
use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;
use SMW\DataTypeRegistry;
use SMW\DIWikiPage;
use SMWDataItem as DataItem;
Expand Down
2 changes: 1 addition & 1 deletion src/ParserFunctionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SCI;

use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;
use SMW\NamespaceExaminer;
use SMW\ParameterProcessorFactory;
use SCI\Bibtex\BibtexProcessor;
Expand Down
2 changes: 1 addition & 1 deletion src/ReferenceListFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SMW\Store;
use SMW\NamespaceExaminer;
use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;
use Onoi\Cache\Cache;
use Parser;

Expand Down
2 changes: 1 addition & 1 deletion src/Specials/CitableMetadata/PageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SCI\Specials\CitableMetadata;

use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;
use SCI\CitationResourceMatchFinder;
use SMW\MediaWiki\Renderer\HtmlFormRenderer;
use SMW\MediaWiki\Renderer\HtmlColumnListRenderer;
Expand Down
2 changes: 1 addition & 1 deletion src/Specials/SpecialFindCitableMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use MediaWiki\MediaWikiServices;
use SpecialPage;
use SMW\ApplicationFactory;
use SMW\Services\ServicesFactory as ApplicationFactory;
use Onoi\HttpRequest\HttpRequestFactory;
use SCI\FilteredMetadata\HttpResponseParserFactory;
use SCI\CitationResourceMatchFinder;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Unit/CitationResourceMatchFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testCanConstruct() {
*/
public function testFindMatchForUidTypeOf( $key, $id ) {

$queryResult = $this->getMockBuilder( '\SMWQueryResult' )
$queryResult = $this->getMockBuilder( '\SMW\Query\QueryResult' )
->disableOriginalConstructor()
->getMock();

Expand Down
18 changes: 9 additions & 9 deletions tests/phpunit/Unit/CitationTextChangeUpdateJobDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public function testDisabledDispatchJob() {

$instance->setEnabledUpdateJobState( false );

$compositePropertyTableDiffIterator = $this->getMockBuilder( '\SMW\SQLStore\CompositePropertyTableDiffIterator' )
$changeOp = $this->getMockBuilder( '\SMW\SQLStore\ChangeOp\ChangeOp' )
->disableOriginalConstructor()
->getMock();

$compositePropertyTableDiffIterator->expects( $this->never() )
$changeOp->expects( $this->never() )
->method( 'getOrderedDiffByTable' );

$subject = DIWikiPage::newFromText( __METHOD__ );

$instance->dispatchUpdateJobFor( $subject, $compositePropertyTableDiffIterator );
$instance->dispatchUpdateJobFor( $subject, $changeOp );
}

/**
Expand Down Expand Up @@ -97,18 +97,18 @@ public function testDispatchJobForDiffableChange( $diff ) {
$this->referenceBacklinksLookup
);

$compositePropertyTableDiffIterator = $this->getMockBuilder( '\SMW\SQLStore\CompositePropertyTableDiffIterator' )
$changeOp = $this->getMockBuilder( '\SMW\SQLStore\ChangeOp\ChangeOp' )
->disableOriginalConstructor()
->getMock();

$compositePropertyTableDiffIterator->expects( $this->once() )
$changeOp->expects( $this->once() )
->method( 'getOrderedDiffByTable' )
->will( $this->returnValue( $diff ) );

$subject = DIWikiPage::newFromText( __METHOD__ );

$this->assertTrue(
$instance->dispatchUpdateJobFor( $subject, $compositePropertyTableDiffIterator )
$instance->dispatchUpdateJobFor( $subject, $changeOp )
);
}

Expand All @@ -129,18 +129,18 @@ public function testDispatchJobForNoValidDiff() {
$this->referenceBacklinksLookup
);

$compositePropertyTableDiffIterator = $this->getMockBuilder( '\SMW\SQLStore\CompositePropertyTableDiffIterator' )
$changeOp = $this->getMockBuilder( '\SMW\SQLStore\ChangeOp\ChangeOp' )
->disableOriginalConstructor()
->getMock();

$compositePropertyTableDiffIterator->expects( $this->once() )
$changeOp->expects( $this->once() )
->method( 'getOrderedDiffByTable' )
->will( $this->returnValue( $diff ) );

$subject = DIWikiPage::newFromText( __METHOD__ );

$this->assertFalse(
$instance->dispatchUpdateJobFor( $subject, $compositePropertyTableDiffIterator )
$instance->dispatchUpdateJobFor( $subject, $changeOp )
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/Unit/HookRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,13 @@ public function doTestRegisteredAfterDataUpdateComplete( $instance ) {
->disableOriginalConstructor()
->getMock();

$compositePropertyTableDiffIterator = $this->getMockBuilder( '\SMW\SQLStore\CompositePropertyTableDiffIterator' )
$changeOp = $this->getMockBuilder( '\SMW\SQLStore\ChangeOp\ChangeOp' )
->disableOriginalConstructor()
->getMock();

$this->assertThatHookIsExcutable(
$instance->getHandlerFor( $hook ),
[ $store, $semanticData, $compositePropertyTableDiffIterator ]
[ $store, $semanticData, $changeOp ]
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Unit/ReferenceBacklinksLookupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function testAddReferenceBacklinks() {
$this->equalTo( new DIProperty( PropertyRegistry::SCI_CITE_REFERENCE ) ),
$this->anything() );

$queryResult = $this->getMockBuilder( '\SMWQueryResult' )
$queryResult = $this->getMockBuilder( '\SMW\Query\QueryResult' )
->disableOriginalConstructor()
->getMock();

Expand Down
Loading