@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | private $propertyDataTypeLookup; |
23 | 23 | |
24 | - public function __construct( PropertyDataTypeLookup $propertyDataTypeLookup ) { |
|
24 | + public function __construct(PropertyDataTypeLookup $propertyDataTypeLookup) { |
|
25 | 25 | $this->propertyDataTypeLookup = $propertyDataTypeLookup; |
26 | 26 | } |
27 | 27 | |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @return bool |
35 | 35 | */ |
36 | - public function isMatchingDataType( PropertyId $propertyId, $dataType ) { |
|
36 | + public function isMatchingDataType(PropertyId $propertyId, $dataType) { |
|
37 | 37 | try { |
38 | - return $this->findDataTypeIdForProperty( $propertyId ) === $dataType; |
|
39 | - } catch ( PropertyDataTypeLookupException ) { |
|
38 | + return $this->findDataTypeIdForProperty($propertyId) === $dataType; |
|
39 | + } catch (PropertyDataTypeLookupException) { |
|
40 | 40 | return false; |
41 | 41 | } |
42 | 42 | } |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @return string |
48 | 48 | * @throws PropertyDataTypeLookupException |
49 | 49 | */ |
50 | - private function findDataTypeIdForProperty( PropertyId $propertyId ) { |
|
51 | - return $this->propertyDataTypeLookup->getDataTypeIdForProperty( $propertyId ); |
|
50 | + private function findDataTypeIdForProperty(PropertyId $propertyId) { |
|
51 | + return $this->propertyDataTypeLookup->getDataTypeIdForProperty($propertyId); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param PropertyDataTypeLookup $dataTypeLookup |
38 | 38 | * @param string[]|string $dataTypes One or more property data type identifiers. |
39 | 39 | */ |
40 | - public function __construct( PropertyDataTypeLookup $dataTypeLookup, $dataTypes ) { |
|
40 | + public function __construct(PropertyDataTypeLookup $dataTypeLookup, $dataTypes) { |
|
41 | 41 | $this->dataTypeLookup = $dataTypeLookup; |
42 | 42 | $this->dataTypes = (array)$dataTypes; |
43 | 43 | } |
@@ -49,16 +49,16 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return bool |
51 | 51 | */ |
52 | - public function statementMatches( Statement $statement ) { |
|
52 | + public function statementMatches(Statement $statement) { |
|
53 | 53 | $id = $statement->getPropertyId(); |
54 | 54 | |
55 | 55 | try { |
56 | - $dataType = $this->dataTypeLookup->getDataTypeIdForProperty( $id ); |
|
57 | - } catch ( PropertyDataTypeLookupException ) { |
|
56 | + $dataType = $this->dataTypeLookup->getDataTypeIdForProperty($id); |
|
57 | + } catch (PropertyDataTypeLookupException) { |
|
58 | 58 | return false; |
59 | 59 | } |
60 | 60 | |
61 | - return in_array( $dataType, $this->dataTypes ); |
|
61 | + return in_array($dataType, $this->dataTypes); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | private $entityIdParser; |
21 | 21 | |
22 | - public function __construct( EntityIdParser $entityIdParser ) { |
|
22 | + public function __construct(EntityIdParser $entityIdParser) { |
|
23 | 23 | $this->entityIdParser = $entityIdParser; |
24 | 24 | } |
25 | 25 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return bool |
34 | 34 | */ |
35 | - public function validate( $guid ) { |
|
36 | - if ( !$this->validateFormat( $guid ) ) { |
|
35 | + public function validate($guid) { |
|
36 | + if (!$this->validateFormat($guid)) { |
|
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
40 | - $guidParts = explode( StatementGuid::SEPARATOR, $guid ); |
|
40 | + $guidParts = explode(StatementGuid::SEPARATOR, $guid); |
|
41 | 41 | |
42 | - if ( !$this->validateStatementGuidPrefix( $guidParts[0] ) || !$this->validateGuid( $guidParts[1] ) ) { |
|
42 | + if (!$this->validateStatementGuidPrefix($guidParts[0]) || !$this->validateGuid($guidParts[1])) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return bool |
57 | 57 | */ |
58 | - public function validateFormat( $guid ) { |
|
59 | - if ( !is_string( $guid ) ) { |
|
58 | + public function validateFormat($guid) { |
|
59 | + if (!is_string($guid)) { |
|
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | |
63 | - $keyParts = explode( '$', $guid ); |
|
63 | + $keyParts = explode('$', $guid); |
|
64 | 64 | |
65 | - if ( count( $keyParts ) !== 2 ) { |
|
65 | + if (count($keyParts) !== 2) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return bool |
80 | 80 | */ |
81 | - private function validateGuid( $guid ) { |
|
81 | + private function validateGuid($guid) { |
|
82 | 82 | return (bool)preg_match( |
83 | 83 | '/^\{?[A-Z\d]{8}-[A-Z\d]{4}-[A-Z\d]{4}-[A-Z\d]{4}-[A-Z\d]{12}\}?\z/i', |
84 | 84 | $guid |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return bool |
96 | 96 | */ |
97 | - private function validateStatementGuidPrefix( $prefixedId ) { |
|
97 | + private function validateStatementGuidPrefix($prefixedId) { |
|
98 | 98 | try { |
99 | - $this->entityIdParser->parse( $prefixedId ); |
|
99 | + $this->entityIdParser->parse($prefixedId); |
|
100 | 100 | return true; |
101 | - } catch ( EntityIdParsingException ) { |
|
101 | + } catch (EntityIdParsingException) { |
|
102 | 102 | return false; |
103 | 103 | } |
104 | 104 | } |