Completed
Push — master ( 79ca72...9ffa4a )
by
unknown
02:55
created
maintenance/ImportConstraintStatements.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 use Wikibase\Repo\WikibaseRepo;
10 10
 
11 11
 // @codeCoverageIgnoreStart
12
-$basePath = getenv( "MW_INSTALL_PATH" ) !== false
13
-	? getenv( "MW_INSTALL_PATH" ) : __DIR__ . "/../../..";
12
+$basePath = getenv("MW_INSTALL_PATH") !== false
13
+	? getenv("MW_INSTALL_PATH") : __DIR__."/../../..";
14 14
 
15
-require_once $basePath . "/maintenance/Maintenance.php";
15
+require_once $basePath."/maintenance/Maintenance.php";
16 16
 // @codeCoverageIgnoreEnd
17 17
 
18 18
 /**
@@ -38,31 +38,31 @@  discard block
 block discarded – undo
38 38
 		parent::__construct();
39 39
 		$repo = WikibaseRepo::getDefaultInstance();
40 40
 		$this->propertyInfoLookup = $repo->getStore()->getPropertyInfoLookup();
41
-		$this->newUpdateConstraintsTableJob = function ( $propertyIdSerialization ) {
41
+		$this->newUpdateConstraintsTableJob = function($propertyIdSerialization) {
42 42
 			return UpdateConstraintsTableJob::newFromGlobalState(
43 43
 				Title::newMainPage(),
44
-				[ 'propertyId' => $propertyIdSerialization ]
44
+				['propertyId' => $propertyIdSerialization]
45 45
 			);
46 46
 		};
47 47
 
48
-		$this->addDescription( 'Imports property constraints from statements on properties' );
49
-		$this->requireExtension( 'WikibaseQualityConstraints' );
48
+		$this->addDescription('Imports property constraints from statements on properties');
49
+		$this->requireExtension('WikibaseQualityConstraints');
50 50
 	}
51 51
 
52 52
 	public function execute() {
53
-		if ( !$this->getConfig()->get( 'WBQualityConstraintsEnableConstraintsImportFromStatements' ) ) {
54
-			$this->error( 'Constraint statements are not enabled. Aborting.' );
53
+		if (!$this->getConfig()->get('WBQualityConstraintsEnableConstraintsImportFromStatements')) {
54
+			$this->error('Constraint statements are not enabled. Aborting.');
55 55
 			return;
56 56
 		}
57 57
 
58
-		foreach ( $this->propertyInfoLookup->getAllPropertyInfo() as $propertyIdSerialization => $info ) {
59
-			$this->output( sprintf( 'Importing constraint statements for % 6s... ', $propertyIdSerialization ), $propertyIdSerialization );
60
-			$startTime = microtime( true );
61
-			$job = call_user_func( $this->newUpdateConstraintsTableJob, $propertyIdSerialization );
58
+		foreach ($this->propertyInfoLookup->getAllPropertyInfo() as $propertyIdSerialization => $info) {
59
+			$this->output(sprintf('Importing constraint statements for % 6s... ', $propertyIdSerialization), $propertyIdSerialization);
60
+			$startTime = microtime(true);
61
+			$job = call_user_func($this->newUpdateConstraintsTableJob, $propertyIdSerialization);
62 62
 			$job->run();
63
-			$endTime = microtime( true );
64
-			$millis = ( $endTime - $startTime ) * 1000;
65
-			$this->output( sprintf( 'done in % 6.2f ms.', $millis ), $propertyIdSerialization );
63
+			$endTime = microtime(true);
64
+			$millis = ($endTime - $startTime) * 1000;
65
+			$this->output(sprintf('done in % 6.2f ms.', $millis), $propertyIdSerialization);
66 66
 		}
67 67
 	}
68 68
 
Please login to merge, or discard this patch.