Passed
Push — master ( aac809...2b08a3 )
by
unknown
02:01
created
src/Lookup/EntityRetrievingDataTypeLookup.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	private $entityLookup;
23 23
 	private array $propertyIdsInProcess = [];
24 24
 
25
-	public function __construct( EntityLookup $entityLookup ) {
25
+	public function __construct(EntityLookup $entityLookup) {
26 26
 		$this->entityLookup = $entityLookup;
27 27
 	}
28 28
 
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 	 * @return string
35 35
 	 * @throws PropertyDataTypeLookupException
36 36
 	 */
37
-	public function getDataTypeIdForProperty( PropertyId $propertyId ) {
38
-		if ( array_key_exists( $propertyId->getSerialization(), $this->propertyIdsInProcess ) ) {
37
+	public function getDataTypeIdForProperty(PropertyId $propertyId) {
38
+		if (array_key_exists($propertyId->getSerialization(), $this->propertyIdsInProcess)) {
39 39
 			// avoid self-referencing loop for newly created properties (T374230)
40
-			throw new PropertyDataTypeLookupException( $propertyId, 'loop detected' );
40
+			throw new PropertyDataTypeLookupException($propertyId, 'loop detected');
41 41
 		}
42
-		$this->propertyIdsInProcess[ $propertyId->getSerialization() ] = true;
43
-		return $this->getProperty( $propertyId )->getDataTypeId();
42
+		$this->propertyIdsInProcess[$propertyId->getSerialization()] = true;
43
+		return $this->getProperty($propertyId)->getDataTypeId();
44 44
 	}
45 45
 
46 46
 	/**
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 	 * @return Property
50 50
 	 * @throws PropertyDataTypeLookupException
51 51
 	 */
52
-	private function getProperty( PropertyId $propertyId ) {
53
-		$property = $this->entityLookup->getEntity( $propertyId );
52
+	private function getProperty(PropertyId $propertyId) {
53
+		$property = $this->entityLookup->getEntity($propertyId);
54 54
 
55
-		if ( !( $property instanceof Property ) ) {
56
-			throw new PropertyDataTypeLookupException( $propertyId );
55
+		if (!($property instanceof Property)) {
56
+			throw new PropertyDataTypeLookupException($propertyId);
57 57
 		}
58 58
 
59
-		unset( $this->propertyIdsInProcess[ $propertyId->getSerialization() ] );
59
+		unset($this->propertyIdsInProcess[$propertyId->getSerialization()]);
60 60
 
61 61
 		return $property;
62 62
 	}
Please login to merge, or discard this patch.