@@ -30,13 +30,13 @@  | 
                                                    ||
| 30 | 30 | private $factory;  | 
                                                        
| 31 | 31 | |
| 32 | 32 |  	private function __construct() { | 
                                                        
| 33 | - $connection = DriverManager::getConnection( array(  | 
                                                        |
| 33 | + $connection = DriverManager::getConnection(array(  | 
                                                        |
| 34 | 34 | 'driver' => 'pdo_sqlite',  | 
                                                        
| 35 | 35 | 'memory' => true,  | 
                                                        
| 36 | - ) );  | 
                                                        |
| 36 | + ));  | 
                                                        |
| 37 | 37 | |
| 38 | - $config = new TermStoreConfig( 'ts_' );  | 
                                                        |
| 39 | - $this->factory = new TermStoreFactory( $connection, $config );  | 
                                                        |
| 38 | +		$config = new TermStoreConfig('ts_'); | 
                                                        |
| 39 | + $this->factory = new TermStoreFactory($connection, $config);  | 
                                                        |
| 40 | 40 | }  | 
                                                        
| 41 | 41 | |
| 42 | 42 |  	public function getFactory() { | 
                                                        
@@ -29,236 +29,236 @@  | 
                                                    ||
| 29 | 29 | }  | 
                                                        
| 30 | 30 | |
| 31 | 31 |  	public function testGivenNotMatchingArgs_getTermByIdAndLanguageReturnsNull() { | 
                                                        
| 32 | - $this->assertNull( $this->store->getLabelByIdAndLanguage( new ItemId( 'Q1337' ), 'en' ) );  | 
                                                        |
| 32 | +		$this->assertNull($this->store->getLabelByIdAndLanguage(new ItemId('Q1337'), 'en')); | 
                                                        |
| 33 | 33 | }  | 
                                                        
| 34 | 34 | |
| 35 | 35 |  	public function testStoreIdAndFingerprint() { | 
                                                        
| 36 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 36 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 37 | 37 | |
| 38 | 38 | $fingerprint = new Fingerprint();  | 
                                                        
| 39 | - $fingerprint->setLabel( 'en', 'en label' );  | 
                                                        |
| 40 | - $fingerprint->setLabel( 'de', 'de label' );  | 
                                                        |
| 41 | - $fingerprint->setDescription( 'en', 'en description' );  | 
                                                        |
| 42 | - $fingerprint->setAliasGroup( 'en', [ 'first en alias', 'second en alias' ] );  | 
                                                        |
| 39 | +		$fingerprint->setLabel('en', 'en label'); | 
                                                        |
| 40 | +		$fingerprint->setLabel('de', 'de label'); | 
                                                        |
| 41 | +		$fingerprint->setDescription('en', 'en description'); | 
                                                        |
| 42 | +		$fingerprint->setAliasGroup('en', [ 'first en alias', 'second en alias' ]); | 
                                                        |
| 43 | 43 | |
| 44 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 44 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 45 | 45 | |
| 46 | 46 | $this->assertSame(  | 
                                                        
| 47 | 47 | 'en label',  | 
                                                        
| 48 | - $this->store->getLabelByIdAndLanguage( $id, 'en' )  | 
                                                        |
| 48 | + $this->store->getLabelByIdAndLanguage($id, 'en')  | 
                                                        |
| 49 | 49 | );  | 
                                                        
| 50 | 50 | |
| 51 | 51 | $this->assertSame(  | 
                                                        
| 52 | 52 | 'de label',  | 
                                                        
| 53 | - $this->store->getLabelByIdAndLanguage( $id, 'de' )  | 
                                                        |
| 53 | + $this->store->getLabelByIdAndLanguage($id, 'de')  | 
                                                        |
| 54 | 54 | );  | 
                                                        
| 55 | 55 | |
| 56 | 56 | $this->assertSame(  | 
                                                        
| 57 | 57 | [ 'first en alias', 'second en alias' ],  | 
                                                        
| 58 | - $this->store->getAliasesByIdAndLanguage( $id, 'en' )  | 
                                                        |
| 58 | + $this->store->getAliasesByIdAndLanguage($id, 'en')  | 
                                                        |
| 59 | 59 | );  | 
                                                        
| 60 | 60 | }  | 
                                                        
| 61 | 61 | |
| 62 | 62 |  	public function testGetIdByLabelAndLanguage() { | 
                                                        
| 63 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 63 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 64 | 64 | |
| 65 | 65 | $fingerprint = new Fingerprint();  | 
                                                        
| 66 | - $fingerprint->setLabel( 'en', 'en label' );  | 
                                                        |
| 67 | - $fingerprint->setLabel( 'de', 'de label' );  | 
                                                        |
| 66 | +		$fingerprint->setLabel('en', 'en label'); | 
                                                        |
| 67 | +		$fingerprint->setLabel('de', 'de label'); | 
                                                        |
| 68 | 68 | |
| 69 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 69 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 70 | 70 | |
| 71 | 71 | $this->assertSame(  | 
                                                        
| 72 | 72 | 'Q1337',  | 
                                                        
| 73 | - $this->store->getIdByLabel( 'en', 'en label' )  | 
                                                        |
| 73 | +			$this->store->getIdByLabel('en', 'en label') | 
                                                        |
| 74 | 74 | );  | 
                                                        
| 75 | 75 | }  | 
                                                        
| 76 | 76 | |
| 77 | 77 |  	public function testStoreFingerprintRemovesOldData() { | 
                                                        
| 78 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 78 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 79 | 79 | |
| 80 | 80 | $fingerprint = new Fingerprint();  | 
                                                        
| 81 | - $fingerprint->setLabel( 'en', 'en label' );  | 
                                                        |
| 82 | - $fingerprint->setLabel( 'de', 'de label' );  | 
                                                        |
| 83 | - $fingerprint->setAliasGroup( 'en', [ 'first en alias', 'second en alias' ] );  | 
                                                        |
| 81 | +		$fingerprint->setLabel('en', 'en label'); | 
                                                        |
| 82 | +		$fingerprint->setLabel('de', 'de label'); | 
                                                        |
| 83 | +		$fingerprint->setAliasGroup('en', [ 'first en alias', 'second en alias' ]); | 
                                                        |
| 84 | 84 | |
| 85 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 85 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 86 | 86 | |
| 87 | 87 | $fingerprint = new Fingerprint();  | 
                                                        
| 88 | - $fingerprint->setLabel( 'de', 'new de label' );  | 
                                                        |
| 88 | +		$fingerprint->setLabel('de', 'new de label'); | 
                                                        |
| 89 | 89 | |
| 90 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 90 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 91 | 91 | |
| 92 | 92 | $this->assertEquals(  | 
                                                        
| 93 | 93 | 'new de label',  | 
                                                        
| 94 | - $this->store->getLabelByIdAndLanguage( $id, 'de' )  | 
                                                        |
| 94 | + $this->store->getLabelByIdAndLanguage($id, 'de')  | 
                                                        |
| 95 | 95 | );  | 
                                                        
| 96 | 96 | |
| 97 | - $this->assertNull( $this->store->getLabelByIdAndLanguage( $id, 'en' ) );  | 
                                                        |
| 98 | - $this->assertEmpty( $this->store->getAliasesByIdAndLanguage( $id, 'en' ) );  | 
                                                        |
| 97 | + $this->assertNull($this->store->getLabelByIdAndLanguage($id, 'en'));  | 
                                                        |
| 98 | + $this->assertEmpty($this->store->getAliasesByIdAndLanguage($id, 'en'));  | 
                                                        |
| 99 | 99 | }  | 
                                                        
| 100 | 100 | |
| 101 | 101 |  	public function testGivenNonMatchingArgs_getAliasesReturnsEmptyArray() { | 
                                                        
| 102 | - $this->assertSame( [], $this->store->getAliasesByIdAndLanguage( new ItemId( 'Q1337' ), 'en' ) );  | 
                                                        |
| 102 | +		$this->assertSame([ ], $this->store->getAliasesByIdAndLanguage(new ItemId('Q1337'), 'en')); | 
                                                        |
| 103 | 103 | }  | 
                                                        
| 104 | 104 | |
| 105 | 105 |  	public function testGetIdByTextReturnsMatchBasedOnLabel() { | 
                                                        
| 106 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 106 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 107 | 107 | |
| 108 | 108 | $fingerprint = new Fingerprint();  | 
                                                        
| 109 | - $fingerprint->setLabel( 'en', 'kittens' );  | 
                                                        |
| 110 | - $fingerprint->setAliasGroup( 'en', [ 'first en alias', 'second en alias' ] );  | 
                                                        |
| 109 | +		$fingerprint->setLabel('en', 'kittens'); | 
                                                        |
| 110 | +		$fingerprint->setAliasGroup('en', [ 'first en alias', 'second en alias' ]); | 
                                                        |
| 111 | 111 | |
| 112 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 112 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 113 | 113 | |
| 114 | - $id = new ItemId( 'Q42' );  | 
                                                        |
| 114 | +		$id = new ItemId('Q42'); | 
                                                        |
| 115 | 115 | |
| 116 | 116 | $fingerprint = new Fingerprint();  | 
                                                        
| 117 | - $fingerprint->setLabel( 'en', 'foobar' );  | 
                                                        |
| 118 | - $fingerprint->setAliasGroup( 'en', [ 'kittens', 'first en alias' ] );  | 
                                                        |
| 117 | +		$fingerprint->setLabel('en', 'foobar'); | 
                                                        |
| 118 | +		$fingerprint->setAliasGroup('en', [ 'kittens', 'first en alias' ]); | 
                                                        |
| 119 | 119 | |
| 120 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 120 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 121 | 121 | |
| 122 | 122 | $this->assertSame(  | 
                                                        
| 123 | 123 | 'Q1337',  | 
                                                        
| 124 | - $this->store->getIdByText( 'en', 'kittens' )  | 
                                                        |
| 124 | +			$this->store->getIdByText('en', 'kittens') | 
                                                        |
| 125 | 125 | );  | 
                                                        
| 126 | 126 | }  | 
                                                        
| 127 | 127 | |
| 128 | 128 |  	public function testGetIdByTextReturnsAliasBasedMatchIfNoLabelsMatch() { | 
                                                        
| 129 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 129 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 130 | 130 | |
| 131 | 131 | $fingerprint = new Fingerprint();  | 
                                                        
| 132 | - $fingerprint->setLabel( 'en', 'foobar' );  | 
                                                        |
| 133 | - $fingerprint->setAliasGroup( 'en', [ 'first en alias', 'second en alias' ] );  | 
                                                        |
| 132 | +		$fingerprint->setLabel('en', 'foobar'); | 
                                                        |
| 133 | +		$fingerprint->setAliasGroup('en', [ 'first en alias', 'second en alias' ]); | 
                                                        |
| 134 | 134 | |
| 135 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 135 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 136 | 136 | |
| 137 | - $id = new ItemId( 'Q42' );  | 
                                                        |
| 137 | +		$id = new ItemId('Q42'); | 
                                                        |
| 138 | 138 | |
| 139 | 139 | $fingerprint = new Fingerprint();  | 
                                                        
| 140 | - $fingerprint->setLabel( 'en', 'foobar' );  | 
                                                        |
| 141 | - $fingerprint->setAliasGroup( 'en', [ 'kittens', 'first en alias' ] );  | 
                                                        |
| 140 | +		$fingerprint->setLabel('en', 'foobar'); | 
                                                        |
| 141 | +		$fingerprint->setAliasGroup('en', [ 'kittens', 'first en alias' ]); | 
                                                        |
| 142 | 142 | |
| 143 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 143 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 144 | 144 | |
| 145 | 145 | $this->assertSame(  | 
                                                        
| 146 | 146 | 'Q42',  | 
                                                        
| 147 | - $this->store->getIdByText( 'en', 'kittens' )  | 
                                                        |
| 147 | +			$this->store->getIdByText('en', 'kittens') | 
                                                        |
| 148 | 148 | );  | 
                                                        
| 149 | 149 | }  | 
                                                        
| 150 | 150 | |
| 151 | 151 |  	public function testByLabelLookupIsCaseInsensitive() { | 
                                                        
| 152 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 152 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 153 | 153 | |
| 154 | 154 | $fingerprint = new Fingerprint();  | 
                                                        
| 155 | - $fingerprint->setLabel( 'en', 'EN label' );  | 
                                                        |
| 155 | +		$fingerprint->setLabel('en', 'EN label'); | 
                                                        |
| 156 | 156 | |
| 157 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 157 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 158 | 158 | |
| 159 | 159 | $this->assertSame(  | 
                                                        
| 160 | 160 | 'Q1337',  | 
                                                        
| 161 | - $this->store->getIdByLabel( 'en', 'en LABEL' )  | 
                                                        |
| 161 | +			$this->store->getIdByLabel('en', 'en LABEL') | 
                                                        |
| 162 | 162 | );  | 
                                                        
| 163 | 163 | }  | 
                                                        
| 164 | 164 | |
| 165 | 165 |  	public function testGetItemIdByLabelReturnsNoPropertyIds() { | 
                                                        
| 166 | - $id = new PropertyId( 'P1337' );  | 
                                                        |
| 166 | +		$id = new PropertyId('P1337'); | 
                                                        |
| 167 | 167 | |
| 168 | 168 | $fingerprint = new Fingerprint();  | 
                                                        
| 169 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 169 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 170 | 170 | |
| 171 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 171 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 172 | 172 | |
| 173 | - $this->assertNull( $this->store->getItemIdByLabel( 'en', 'some label' ) );  | 
                                                        |
| 173 | +		$this->assertNull($this->store->getItemIdByLabel('en', 'some label')); | 
                                                        |
| 174 | 174 | }  | 
                                                        
| 175 | 175 | |
| 176 | 176 |  	public function testGetPropertyIdByLabelReturnsNoItemIds() { | 
                                                        
| 177 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 177 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 178 | 178 | |
| 179 | 179 | $fingerprint = new Fingerprint();  | 
                                                        
| 180 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 180 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 181 | 181 | |
| 182 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 182 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 183 | 183 | |
| 184 | - $this->assertNull( $this->store->getPropertyIdByLabel( 'en', 'some label' ) );  | 
                                                        |
| 184 | +		$this->assertNull($this->store->getPropertyIdByLabel('en', 'some label')); | 
                                                        |
| 185 | 185 | }  | 
                                                        
| 186 | 186 | |
| 187 | 187 |  	public function testGetItemIdByLabelReturnsItemIds() { | 
                                                        
| 188 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 188 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 189 | 189 | |
| 190 | 190 | $fingerprint = new Fingerprint();  | 
                                                        
| 191 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 191 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 192 | 192 | |
| 193 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 193 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 194 | 194 | |
| 195 | 195 | $this->assertSame(  | 
                                                        
| 196 | 196 | 'Q1337',  | 
                                                        
| 197 | - $this->store->getItemIdByLabel( 'en', 'some label' )  | 
                                                        |
| 197 | +			$this->store->getItemIdByLabel('en', 'some label') | 
                                                        |
| 198 | 198 | );  | 
                                                        
| 199 | 199 | }  | 
                                                        
| 200 | 200 | |
| 201 | 201 |  	public function testGetPropertyIdByLabelReturnsPropertyIds() { | 
                                                        
| 202 | - $id = new PropertyId( 'P1337' );  | 
                                                        |
| 202 | +		$id = new PropertyId('P1337'); | 
                                                        |
| 203 | 203 | |
| 204 | 204 | $fingerprint = new Fingerprint();  | 
                                                        
| 205 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 205 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 206 | 206 | |
| 207 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 207 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 208 | 208 | |
| 209 | 209 | $this->assertSame(  | 
                                                        
| 210 | 210 | 'P1337',  | 
                                                        
| 211 | - $this->store->getPropertyIdByLabel( 'en', 'some label' )  | 
                                                        |
| 211 | +			$this->store->getPropertyIdByLabel('en', 'some label') | 
                                                        |
| 212 | 212 | );  | 
                                                        
| 213 | 213 | }  | 
                                                        
| 214 | 214 | |
| 215 | 215 |  	public function testGetItemIdByTextReturnsNoPropertyIds() { | 
                                                        
| 216 | - $id = new PropertyId( 'P1337' );  | 
                                                        |
| 216 | +		$id = new PropertyId('P1337'); | 
                                                        |
| 217 | 217 | |
| 218 | 218 | $fingerprint = new Fingerprint();  | 
                                                        
| 219 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 219 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 220 | 220 | |
| 221 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 221 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 222 | 222 | |
| 223 | - $this->assertNull( $this->store->getItemIdByText( 'en', 'some label' ) );  | 
                                                        |
| 223 | +		$this->assertNull($this->store->getItemIdByText('en', 'some label')); | 
                                                        |
| 224 | 224 | }  | 
                                                        
| 225 | 225 | |
| 226 | 226 |  	public function testGetPropertyIdByTextReturnsNoItemIds() { | 
                                                        
| 227 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 227 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 228 | 228 | |
| 229 | 229 | $fingerprint = new Fingerprint();  | 
                                                        
| 230 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 230 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 231 | 231 | |
| 232 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 232 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 233 | 233 | |
| 234 | - $this->assertNull( $this->store->getPropertyIdByText( 'en', 'some label' ) );  | 
                                                        |
| 234 | +		$this->assertNull($this->store->getPropertyIdByText('en', 'some label')); | 
                                                        |
| 235 | 235 | }  | 
                                                        
| 236 | 236 | |
| 237 | 237 |  	public function testGetItemIdByTextReturnsItemIds() { | 
                                                        
| 238 | - $id = new ItemId( 'Q1337' );  | 
                                                        |
| 238 | +		$id = new ItemId('Q1337'); | 
                                                        |
| 239 | 239 | |
| 240 | 240 | $fingerprint = new Fingerprint();  | 
                                                        
| 241 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 241 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 242 | 242 | |
| 243 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 243 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 244 | 244 | |
| 245 | 245 | $this->assertSame(  | 
                                                        
| 246 | 246 | 'Q1337',  | 
                                                        
| 247 | - $this->store->getItemIdByText( 'en', 'some label' )  | 
                                                        |
| 247 | +			$this->store->getItemIdByText('en', 'some label') | 
                                                        |
| 248 | 248 | );  | 
                                                        
| 249 | 249 | }  | 
                                                        
| 250 | 250 | |
| 251 | 251 |  	public function testGetPropertyIdByTextReturnsPropertyIds() { | 
                                                        
| 252 | - $id = new PropertyId( 'P1337' );  | 
                                                        |
| 252 | +		$id = new PropertyId('P1337'); | 
                                                        |
| 253 | 253 | |
| 254 | 254 | $fingerprint = new Fingerprint();  | 
                                                        
| 255 | - $fingerprint->setLabel( 'en', 'some label' );  | 
                                                        |
| 255 | +		$fingerprint->setLabel('en', 'some label'); | 
                                                        |
| 256 | 256 | |
| 257 | - $this->store->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 257 | + $this->store->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 258 | 258 | |
| 259 | 259 | $this->assertSame(  | 
                                                        
| 260 | 260 | 'P1337',  | 
                                                        
| 261 | - $this->store->getPropertyIdByText( 'en', 'some label' )  | 
                                                        |
| 261 | +			$this->store->getPropertyIdByText('en', 'some label') | 
                                                        |
| 262 | 262 | );  | 
                                                        
| 263 | 263 | }  | 
                                                        
| 264 | 264 | |
@@ -1,18 +1,18 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | |
| 3 | -if ( PHP_SAPI !== 'cli' ) { | 
                                                        |
| 4 | - die( 'Not an entry point' );  | 
                                                        |
| 3 | +if (PHP_SAPI !== 'cli') { | 
                                                        |
| 4 | +	die('Not an entry point'); | 
                                                        |
| 5 | 5 | }  | 
                                                        
| 6 | 6 | |
| 7 | -error_reporting( E_ALL | E_STRICT );  | 
                                                        |
| 8 | -ini_set( 'display_errors', 1 );  | 
                                                        |
| 7 | +error_reporting(E_ALL | E_STRICT);  | 
                                                        |
| 8 | +ini_set('display_errors', 1); | 
                                                        |
| 9 | 9 | |
| 10 | -if ( !is_readable( __DIR__ . '/../vendor/autoload.php' ) ) { | 
                                                        |
| 11 | - die( 'You need to install this package with Composer before you can run the tests' );  | 
                                                        |
| 10 | +if (!is_readable(__DIR__.'/../vendor/autoload.php')) { | 
                                                        |
| 11 | +	die('You need to install this package with Composer before you can run the tests'); | 
                                                        |
| 12 | 12 | }  | 
                                                        
| 13 | 13 | |
| 14 | -$autoLoader = require __DIR__ . '/../vendor/autoload.php';  | 
                                                        |
| 14 | +$autoLoader = require __DIR__.'/../vendor/autoload.php';  | 
                                                        |
| 15 | 15 | |
| 16 | -$autoLoader->addPsr4( 'Tests\\Queryr\\TermStore\\', __DIR__ . '/integration' );  | 
                                                        |
| 16 | +$autoLoader->addPsr4('Tests\\Queryr\\TermStore\\', __DIR__.'/integration'); | 
                                                        |
| 17 | 17 | |
| 18 | -unset( $autoLoader );  | 
                                                        |
| 19 | 18 | \ No newline at end of file  | 
                                                        
| 19 | +unset($autoLoader);  | 
                                                        |
| 20 | 20 | \ No newline at end of file  | 
                                                        
@@ -15,70 +15,70 @@  | 
                                                    ||
| 15 | 15 | private $connection;  | 
                                                        
| 16 | 16 | private $tableName;  | 
                                                        
| 17 | 17 | |
| 18 | -	public function __construct( Connection $connection, $tableName ) { | 
                                                        |
| 18 | +	public function __construct(Connection $connection, $tableName) { | 
                                                        |
| 19 | 19 | $this->connection = $connection;  | 
                                                        
| 20 | 20 | $this->tableName = $tableName;  | 
                                                        
| 21 | 21 | }  | 
                                                        
| 22 | 22 | |
| 23 | -	public function selectOneField( $fieldName, array $conditions = [] ) { | 
                                                        |
| 24 | - return $this->selectOne( [ $fieldName ], $conditions )[$fieldName];  | 
                                                        |
| 23 | +	public function selectOneField($fieldName, array $conditions = [ ]) { | 
                                                        |
| 24 | + return $this->selectOne([ $fieldName ], $conditions)[ $fieldName ];  | 
                                                        |
| 25 | 25 | }  | 
                                                        
| 26 | 26 | |
| 27 | -	public function selectOne( array $fieldNames = null, array $conditions = [] ) { | 
                                                        |
| 28 | - $statement = $this->executeSelect( $fieldNames, $conditions, 1 );  | 
                                                        |
| 27 | +	public function selectOne(array $fieldNames = null, array $conditions = [ ]) { | 
                                                        |
| 28 | + $statement = $this->executeSelect($fieldNames, $conditions, 1);  | 
                                                        |
| 29 | 29 | |
| 30 | 30 | $result = $statement->fetch();  | 
                                                        
| 31 | 31 | return $result === false ? null : $result;  | 
                                                        
| 32 | 32 | }  | 
                                                        
| 33 | 33 | |
| 34 | -	public function select( array $fieldNames = null, array $conditions = [] ) { | 
                                                        |
| 35 | - $statement = $this->executeSelect( $fieldNames, $conditions );  | 
                                                        |
| 34 | +	public function select(array $fieldNames = null, array $conditions = [ ]) { | 
                                                        |
| 35 | + $statement = $this->executeSelect($fieldNames, $conditions);  | 
                                                        |
| 36 | 36 | return $statement->fetchAll();  | 
                                                        
| 37 | 37 | }  | 
                                                        
| 38 | 38 | |
| 39 | -	public function selectField( $fieldName, array $conditions = [] ) { | 
                                                        |
| 39 | +	public function selectField($fieldName, array $conditions = [ ]) { | 
                                                        |
| 40 | 40 | return array_map(  | 
                                                        
| 41 | -			function( array $resultRow ) use ( $fieldName ) { | 
                                                        |
| 42 | - return $resultRow[$fieldName];  | 
                                                        |
| 41 | +			function(array $resultRow) use ($fieldName) { | 
                                                        |
| 42 | + return $resultRow[ $fieldName ];  | 
                                                        |
| 43 | 43 | },  | 
                                                        
| 44 | - $this->select( [ $fieldName ], $conditions )  | 
                                                        |
| 44 | + $this->select([ $fieldName ], $conditions)  | 
                                                        |
| 45 | 45 | );  | 
                                                        
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | -	private function executeSelect( array $fieldNames = null, array $conditions = [], $limit = null ) { | 
                                                        |
| 49 | - $sql = $this->buildSelectSql( $fieldNames, $conditions, $limit );  | 
                                                        |
| 48 | +	private function executeSelect(array $fieldNames = null, array $conditions = [ ], $limit = null) { | 
                                                        |
| 49 | + $sql = $this->buildSelectSql($fieldNames, $conditions, $limit);  | 
                                                        |
| 50 | 50 | |
| 51 | - $statement = $this->connection->prepare( $sql );  | 
                                                        |
| 52 | - $statement->execute( array_values( $conditions ) );  | 
                                                        |
| 51 | + $statement = $this->connection->prepare($sql);  | 
                                                        |
| 52 | + $statement->execute(array_values($conditions));  | 
                                                        |
| 53 | 53 | |
| 54 | 54 | return $statement;  | 
                                                        
| 55 | 55 | }  | 
                                                        
| 56 | 56 | |
| 57 | -	private function buildSelectSql( array $fieldNames = null, array $conditions = [], $limit = null ) { | 
                                                        |
| 58 | - $fieldSql = $this->getFieldSql( $fieldNames );  | 
                                                        |
| 59 | - $conditionSql = $this->getConditionSql( $conditions );  | 
                                                        |
| 57 | +	private function buildSelectSql(array $fieldNames = null, array $conditions = [ ], $limit = null) { | 
                                                        |
| 58 | + $fieldSql = $this->getFieldSql($fieldNames);  | 
                                                        |
| 59 | + $conditionSql = $this->getConditionSql($conditions);  | 
                                                        |
| 60 | 60 | |
| 61 | - $sql = 'SELECT ' . $fieldSql . ' FROM ' . $this->tableName . ' WHERE ' . $conditionSql;  | 
                                                        |
| 61 | + $sql = 'SELECT '.$fieldSql.' FROM '.$this->tableName.' WHERE '.$conditionSql;  | 
                                                        |
| 62 | 62 | |
| 63 | -		if ( $limit !== null ) { | 
                                                        |
| 64 | - $sql .= ' LIMIT ' . (int)$limit;  | 
                                                        |
| 63 | +		if ($limit !== null) { | 
                                                        |
| 64 | + $sql .= ' LIMIT '.(int)$limit;  | 
                                                        |
| 65 | 65 | }  | 
                                                        
| 66 | 66 | |
| 67 | 67 | return $sql;  | 
                                                        
| 68 | 68 | }  | 
                                                        
| 69 | 69 | |
| 70 | -	private function getFieldSql( array $fields = null ) { | 
                                                        |
| 71 | - return $fields === null || $fields === [] ? '*' : implode( ', ', (array)$fields );  | 
                                                        |
| 70 | +	private function getFieldSql(array $fields = null) { | 
                                                        |
| 71 | +		return $fields === null || $fields === [ ] ? '*' : implode(', ', (array)$fields); | 
                                                        |
| 72 | 72 | }  | 
                                                        
| 73 | 73 | |
| 74 | -	private function getConditionSql( array $conditions ) { | 
                                                        |
| 75 | - $wherePredicates = [];  | 
                                                        |
| 74 | +	private function getConditionSql(array $conditions) { | 
                                                        |
| 75 | + $wherePredicates = [ ];  | 
                                                        |
| 76 | 76 | |
| 77 | -		foreach ( $conditions as $columnName => $columnValue ) { | 
                                                        |
| 78 | - $wherePredicates[] = $columnName . ' = ?';  | 
                                                        |
| 77 | +		foreach ($conditions as $columnName => $columnValue) { | 
                                                        |
| 78 | + $wherePredicates[ ] = $columnName.' = ?';  | 
                                                        |
| 79 | 79 | }  | 
                                                        
| 80 | 80 | |
| 81 | - return implode( ' AND ', $wherePredicates );  | 
                                                        |
| 81 | +		return implode(' AND ', $wherePredicates); | 
                                                        |
| 82 | 82 | }  | 
                                                        
| 83 | 83 | |
| 84 | 84 | }  | 
                                                        
@@ -20,7 +20,7 @@ discard block  | 
                                                    ||
| 20 | 20 | * @return string|null  | 
                                                        
| 21 | 21 | * @throws TermStoreException  | 
                                                        
| 22 | 22 | */  | 
                                                        
| 23 | - public function getIdByLabel( $labelLanguageCode, $labelText );  | 
                                                        |
| 23 | + public function getIdByLabel($labelLanguageCode, $labelText);  | 
                                                        |
| 24 | 24 | |
| 25 | 25 | /**  | 
                                                        
| 26 | 26 | * Returns the first matching item id. Case insensitive.  | 
                                                        
@@ -31,7 +31,7 @@ discard block  | 
                                                    ||
| 31 | 31 | * @return string|null  | 
                                                        
| 32 | 32 | * @throws TermStoreException  | 
                                                        
| 33 | 33 | */  | 
                                                        
| 34 | - public function getItemIdByLabel( $labelLanguageCode, $labelText );  | 
                                                        |
| 34 | + public function getItemIdByLabel($labelLanguageCode, $labelText);  | 
                                                        |
| 35 | 35 | |
| 36 | 36 | /**  | 
                                                        
| 37 | 37 | * Returns the first matching property id. Case insensitive.  | 
                                                        
@@ -42,7 +42,7 @@ discard block  | 
                                                    ||
| 42 | 42 | * @return string|null  | 
                                                        
| 43 | 43 | * @throws TermStoreException  | 
                                                        
| 44 | 44 | */  | 
                                                        
| 45 | - public function getPropertyIdByLabel( $labelLanguageCode, $labelText );  | 
                                                        |
| 45 | + public function getPropertyIdByLabel($labelLanguageCode, $labelText);  | 
                                                        |
| 46 | 46 | |
| 47 | 47 | /**  | 
                                                        
| 48 | 48 | * Returns the first matching entity id. Case insensitive.  | 
                                                        
@@ -53,7 +53,7 @@ discard block  | 
                                                    ||
| 53 | 53 | * @return string|null  | 
                                                        
| 54 | 54 | * @throws TermStoreException  | 
                                                        
| 55 | 55 | */  | 
                                                        
| 56 | - public function getIdByText( $languageCode, $termText );  | 
                                                        |
| 56 | + public function getIdByText($languageCode, $termText);  | 
                                                        |
| 57 | 57 | |
| 58 | 58 | /**  | 
                                                        
| 59 | 59 | * Returns the first matching item id. Case insensitive.  | 
                                                        
@@ -64,7 +64,7 @@ discard block  | 
                                                    ||
| 64 | 64 | * @return string|null  | 
                                                        
| 65 | 65 | * @throws TermStoreException  | 
                                                        
| 66 | 66 | */  | 
                                                        
| 67 | - public function getItemIdByText( $languageCode, $termText );  | 
                                                        |
| 67 | + public function getItemIdByText($languageCode, $termText);  | 
                                                        |
| 68 | 68 | |
| 69 | 69 | /**  | 
                                                        
| 70 | 70 | * Returns the first matching property id. Case insensitive.  | 
                                                        
@@ -75,6 +75,6 @@ discard block  | 
                                                    ||
| 75 | 75 | * @return string|null  | 
                                                        
| 76 | 76 | * @throws TermStoreException  | 
                                                        
| 77 | 77 | */  | 
                                                        
| 78 | - public function getPropertyIdByText( $languageCode, $termText );  | 
                                                        |
| 78 | + public function getPropertyIdByText($languageCode, $termText);  | 
                                                        |
| 79 | 79 | |
| 80 | 80 | }  | 
                                                        
| 81 | 81 | \ No newline at end of file  | 
                                                        
@@ -13,16 +13,16 @@  | 
                                                    ||
| 13 | 13 | |
| 14 | 14 | private $prefix;  | 
                                                        
| 15 | 15 | |
| 16 | -	public function __construct( $tablePrefix = '' ) { | 
                                                        |
| 16 | +	public function __construct($tablePrefix = '') { | 
                                                        |
| 17 | 17 | $this->prefix = $tablePrefix;  | 
                                                        
| 18 | 18 | }  | 
                                                        
| 19 | 19 | |
| 20 | 20 |  	public function getLabelTableName() { | 
                                                        
| 21 | - return $this->prefix . 'labels';  | 
                                                        |
| 21 | + return $this->prefix.'labels';  | 
                                                        |
| 22 | 22 | }  | 
                                                        
| 23 | 23 | |
| 24 | 24 |  	public function getAliasesTableName() { | 
                                                        
| 25 | - return $this->prefix . 'aliases';  | 
                                                        |
| 25 | + return $this->prefix.'aliases';  | 
                                                        |
| 26 | 26 | }  | 
                                                        
| 27 | 27 | |
| 28 | 28 | }  | 
                                                        
| 29 | 29 | \ No newline at end of file  | 
                                                        
@@ -22,12 +22,12 @@ discard block  | 
                                                    ||
| 22 | 22 | private $labelTable;  | 
                                                        
| 23 | 23 | private $aliasesTable;  | 
                                                        
| 24 | 24 | |
| 25 | -	public function __construct( Connection $connection, TermStoreConfig $config ) { | 
                                                        |
| 26 | - $this->labelTable = new TableQueryExecutor( $connection, $config->getLabelTableName() );  | 
                                                        |
| 27 | - $this->aliasesTable = new TableQueryExecutor( $connection, $config->getAliasesTableName() );  | 
                                                        |
| 25 | +	public function __construct(Connection $connection, TermStoreConfig $config) { | 
                                                        |
| 26 | + $this->labelTable = new TableQueryExecutor($connection, $config->getLabelTableName());  | 
                                                        |
| 27 | + $this->aliasesTable = new TableQueryExecutor($connection, $config->getAliasesTableName());  | 
                                                        |
| 28 | 28 | |
| 29 | - $this->storeWriter = new TermStoreWriter( $connection, $config );  | 
                                                        |
| 30 | - $this->idLookup = new IdLookup( $this->labelTable, $this->aliasesTable );  | 
                                                        |
| 29 | + $this->storeWriter = new TermStoreWriter($connection, $config);  | 
                                                        |
| 30 | + $this->idLookup = new IdLookup($this->labelTable, $this->aliasesTable);  | 
                                                        |
| 31 | 31 | }  | 
                                                        
| 32 | 32 | |
| 33 | 33 | /**  | 
                                                        
@@ -36,8 +36,8 @@ discard block  | 
                                                    ||
| 36 | 36 | *  | 
                                                        
| 37 | 37 | * @throws TermStoreException  | 
                                                        
| 38 | 38 | */  | 
                                                        
| 39 | -	public function storeEntityFingerprint( EntityId $id, Fingerprint $fingerprint ) { | 
                                                        |
| 40 | - $this->storeWriter->storeEntityFingerprint( $id, $fingerprint );  | 
                                                        |
| 39 | +	public function storeEntityFingerprint(EntityId $id, Fingerprint $fingerprint) { | 
                                                        |
| 40 | + $this->storeWriter->storeEntityFingerprint($id, $fingerprint);  | 
                                                        |
| 41 | 41 | }  | 
                                                        
| 42 | 42 | |
| 43 | 43 | /**  | 
                                                        
@@ -45,8 +45,8 @@ discard block  | 
                                                    ||
| 45 | 45 | *  | 
                                                        
| 46 | 46 | * @throws TermStoreException  | 
                                                        
| 47 | 47 | */  | 
                                                        
| 48 | -	public function dropTermsForId( EntityId $id ) { | 
                                                        |
| 49 | - $this->storeWriter->dropTermsForId( $id );  | 
                                                        |
| 48 | +	public function dropTermsForId(EntityId $id) { | 
                                                        |
| 49 | + $this->storeWriter->dropTermsForId($id);  | 
                                                        |
| 50 | 50 | }  | 
                                                        
| 51 | 51 | |
| 52 | 52 | /**  | 
                                                        
@@ -56,7 +56,7 @@ discard block  | 
                                                    ||
| 56 | 56 | * @return string|null  | 
                                                        
| 57 | 57 | * @throws TermStoreException  | 
                                                        
| 58 | 58 | */  | 
                                                        
| 59 | -	public function getLabelByIdAndLanguage( EntityId $id, $languageCode ) { | 
                                                        |
| 59 | +	public function getLabelByIdAndLanguage(EntityId $id, $languageCode) { | 
                                                        |
| 60 | 60 |  		try { | 
                                                        
| 61 | 61 | return $this->labelTable->selectOneField(  | 
                                                        
| 62 | 62 | 'text',  | 
                                                        
@@ -66,8 +66,8 @@ discard block  | 
                                                    ||
| 66 | 66 | ]  | 
                                                        
| 67 | 67 | );  | 
                                                        
| 68 | 68 | }  | 
                                                        
| 69 | -		catch ( DBALException $ex ) { | 
                                                        |
| 70 | - throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        |
| 69 | +		catch (DBALException $ex) { | 
                                                        |
| 70 | + throw new TermStoreException($ex->getMessage(), $ex);  | 
                                                        |
| 71 | 71 | }  | 
                                                        
| 72 | 72 | }  | 
                                                        
| 73 | 73 | |
@@ -78,7 +78,7 @@ discard block  | 
                                                    ||
| 78 | 78 | * @return string[]  | 
                                                        
| 79 | 79 | * @throws TermStoreException  | 
                                                        
| 80 | 80 | */  | 
                                                        
| 81 | -	public function getAliasesByIdAndLanguage( EntityId $id, $languageCode ) { | 
                                                        |
| 81 | +	public function getAliasesByIdAndLanguage(EntityId $id, $languageCode) { | 
                                                        |
| 82 | 82 |  		try { | 
                                                        
| 83 | 83 | return $this->aliasesTable->selectField(  | 
                                                        
| 84 | 84 | 'text',  | 
                                                        
@@ -88,8 +88,8 @@ discard block  | 
                                                    ||
| 88 | 88 | ]  | 
                                                        
| 89 | 89 | );  | 
                                                        
| 90 | 90 | }  | 
                                                        
| 91 | -		catch ( DBALException $ex ) { | 
                                                        |
| 92 | - throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        |
| 91 | +		catch (DBALException $ex) { | 
                                                        |
| 92 | + throw new TermStoreException($ex->getMessage(), $ex);  | 
                                                        |
| 93 | 93 | }  | 
                                                        
| 94 | 94 | }  | 
                                                        
| 95 | 95 | |
@@ -102,8 +102,8 @@ discard block  | 
                                                    ||
| 102 | 102 | * @return string|null  | 
                                                        
| 103 | 103 | * @throws TermStoreException  | 
                                                        
| 104 | 104 | */  | 
                                                        
| 105 | -	public function getIdByLabel( $labelLanguageCode, $labelText ) { | 
                                                        |
| 106 | - return $this->idLookup->getIdByLabel( $labelLanguageCode, $labelText );  | 
                                                        |
| 105 | +	public function getIdByLabel($labelLanguageCode, $labelText) { | 
                                                        |
| 106 | + return $this->idLookup->getIdByLabel($labelLanguageCode, $labelText);  | 
                                                        |
| 107 | 107 | }  | 
                                                        
| 108 | 108 | |
| 109 | 109 | /**  | 
                                                        
@@ -115,8 +115,8 @@ discard block  | 
                                                    ||
| 115 | 115 | * @return string|null  | 
                                                        
| 116 | 116 | * @throws TermStoreException  | 
                                                        
| 117 | 117 | */  | 
                                                        
| 118 | -	public function getItemIdByLabel( $labelLanguageCode, $labelText ) { | 
                                                        |
| 119 | - return $this->idLookup->getItemIdByLabel( $labelLanguageCode, $labelText );  | 
                                                        |
| 118 | +	public function getItemIdByLabel($labelLanguageCode, $labelText) { | 
                                                        |
| 119 | + return $this->idLookup->getItemIdByLabel($labelLanguageCode, $labelText);  | 
                                                        |
| 120 | 120 | }  | 
                                                        
| 121 | 121 | |
| 122 | 122 | /**  | 
                                                        
@@ -128,8 +128,8 @@ discard block  | 
                                                    ||
| 128 | 128 | * @return string|null  | 
                                                        
| 129 | 129 | * @throws TermStoreException  | 
                                                        
| 130 | 130 | */  | 
                                                        
| 131 | -	public function getPropertyIdByLabel( $labelLanguageCode, $labelText ) { | 
                                                        |
| 132 | - return $this->idLookup->getPropertyIdByLabel( $labelLanguageCode, $labelText );  | 
                                                        |
| 131 | +	public function getPropertyIdByLabel($labelLanguageCode, $labelText) { | 
                                                        |
| 132 | + return $this->idLookup->getPropertyIdByLabel($labelLanguageCode, $labelText);  | 
                                                        |
| 133 | 133 | }  | 
                                                        
| 134 | 134 | |
| 135 | 135 | /**  | 
                                                        
@@ -141,8 +141,8 @@ discard block  | 
                                                    ||
| 141 | 141 | * @return string|null  | 
                                                        
| 142 | 142 | * @throws TermStoreException  | 
                                                        
| 143 | 143 | */  | 
                                                        
| 144 | -	public function getIdByText( $languageCode, $termText ) { | 
                                                        |
| 145 | - return $this->idLookup->getIdByText( $languageCode, $termText );  | 
                                                        |
| 144 | +	public function getIdByText($languageCode, $termText) { | 
                                                        |
| 145 | + return $this->idLookup->getIdByText($languageCode, $termText);  | 
                                                        |
| 146 | 146 | }  | 
                                                        
| 147 | 147 | |
| 148 | 148 | /**  | 
                                                        
@@ -154,8 +154,8 @@ discard block  | 
                                                    ||
| 154 | 154 | * @return string|null  | 
                                                        
| 155 | 155 | * @throws TermStoreException  | 
                                                        
| 156 | 156 | */  | 
                                                        
| 157 | -	public function getItemIdByText( $languageCode, $termText ) { | 
                                                        |
| 158 | - return $this->idLookup->getItemIdByText( $languageCode, $termText );  | 
                                                        |
| 157 | +	public function getItemIdByText($languageCode, $termText) { | 
                                                        |
| 158 | + return $this->idLookup->getItemIdByText($languageCode, $termText);  | 
                                                        |
| 159 | 159 | }  | 
                                                        
| 160 | 160 | |
| 161 | 161 | /**  | 
                                                        
@@ -167,8 +167,8 @@ discard block  | 
                                                    ||
| 167 | 167 | * @return string|null  | 
                                                        
| 168 | 168 | * @throws TermStoreException  | 
                                                        
| 169 | 169 | */  | 
                                                        
| 170 | -	public function getPropertyIdByText( $languageCode, $termText ) { | 
                                                        |
| 171 | - return $this->idLookup->getPropertyIdByText( $languageCode, $termText );  | 
                                                        |
| 170 | +	public function getPropertyIdByText($languageCode, $termText) { | 
                                                        |
| 171 | + return $this->idLookup->getPropertyIdByText($languageCode, $termText);  | 
                                                        |
| 172 | 172 | }  | 
                                                        
| 173 | 173 | |
| 174 | 174 | }  | 
                                                        
@@ -65,8 +65,7 @@ discard block  | 
                                                    ||
| 65 | 65 | 'language' => $languageCode  | 
                                                        
| 66 | 66 | ]  | 
                                                        
| 67 | 67 | );  | 
                                                        
| 68 | - }  | 
                                                        |
| 69 | -		catch ( DBALException $ex ) { | 
                                                        |
| 68 | +		} catch ( DBALException $ex ) { | 
                                                        |
| 70 | 69 | throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        
| 71 | 70 | }  | 
                                                        
| 72 | 71 | }  | 
                                                        
@@ -87,8 +86,7 @@ discard block  | 
                                                    ||
| 87 | 86 | 'language' => $languageCode  | 
                                                        
| 88 | 87 | ]  | 
                                                        
| 89 | 88 | );  | 
                                                        
| 90 | - }  | 
                                                        |
| 91 | -		catch ( DBALException $ex ) { | 
                                                        |
| 89 | +		} catch ( DBALException $ex ) { | 
                                                        |
| 92 | 90 | throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        
| 93 | 91 | }  | 
                                                        
| 94 | 92 | }  | 
                                                        
@@ -21,7 +21,7 @@ discard block  | 
                                                    ||
| 21 | 21 | private $connection;  | 
                                                        
| 22 | 22 | private $config;  | 
                                                        
| 23 | 23 | |
| 24 | -	public function __construct( Connection $connection, TermStoreConfig $config ) { | 
                                                        |
| 24 | +	public function __construct(Connection $connection, TermStoreConfig $config) { | 
                                                        |
| 25 | 25 | $this->connection = $connection;  | 
                                                        
| 26 | 26 | $this->config = $config;  | 
                                                        
| 27 | 27 | }  | 
                                                        
@@ -32,35 +32,35 @@ discard block  | 
                                                    ||
| 32 | 32 | *  | 
                                                        
| 33 | 33 | * @throws TermStoreException  | 
                                                        
| 34 | 34 | */  | 
                                                        
| 35 | -	public function storeEntityFingerprint( EntityId $id, Fingerprint $fingerprint ) { | 
                                                        |
| 35 | +	public function storeEntityFingerprint(EntityId $id, Fingerprint $fingerprint) { | 
                                                        |
| 36 | 36 | $this->connection->beginTransaction();  | 
                                                        
| 37 | 37 | |
| 38 | - $this->dropTermsForId( $id );  | 
                                                        |
| 38 | + $this->dropTermsForId($id);  | 
                                                        |
| 39 | 39 | |
| 40 | 40 |  		try { | 
                                                        
| 41 | - $this->storeFingerprintParts( $id, $fingerprint );  | 
                                                        |
| 41 | + $this->storeFingerprintParts($id, $fingerprint);  | 
                                                        |
| 42 | 42 | }  | 
                                                        
| 43 | -		catch ( DBALException $ex ) { | 
                                                        |
| 43 | +		catch (DBALException $ex) { | 
                                                        |
| 44 | 44 | $this->connection->rollBack();  | 
                                                        
| 45 | - throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        |
| 45 | + throw new TermStoreException($ex->getMessage(), $ex);  | 
                                                        |
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | 48 | $this->connection->commit();  | 
                                                        
| 49 | 49 | }  | 
                                                        
| 50 | 50 | |
| 51 | -	private function storeFingerprintParts( EntityId $id, Fingerprint $fingerprint ) { | 
                                                        |
| 51 | +	private function storeFingerprintParts(EntityId $id, Fingerprint $fingerprint) { | 
                                                        |
| 52 | 52 | /**  | 
                                                        
| 53 | 53 | * @var Term $label  | 
                                                        
| 54 | 54 | */  | 
                                                        
| 55 | -		foreach ( $fingerprint->getLabels() as $label ) { | 
                                                        |
| 56 | - $this->storeLabel( $label->getLanguageCode(), $label->getText(), $id );  | 
                                                        |
| 55 | +		foreach ($fingerprint->getLabels() as $label) { | 
                                                        |
| 56 | + $this->storeLabel($label->getLanguageCode(), $label->getText(), $id);  | 
                                                        |
| 57 | 57 | }  | 
                                                        
| 58 | 58 | |
| 59 | 59 | /**  | 
                                                        
| 60 | 60 | * @var AliasGroup $aliasGroup  | 
                                                        
| 61 | 61 | */  | 
                                                        
| 62 | -		foreach ( $fingerprint->getAliasGroups() as $aliasGroup ) { | 
                                                        |
| 63 | - $this->storeAliases( $aliasGroup, $id );  | 
                                                        |
| 62 | +		foreach ($fingerprint->getAliasGroups() as $aliasGroup) { | 
                                                        |
| 63 | + $this->storeAliases($aliasGroup, $id);  | 
                                                        |
| 64 | 64 | }  | 
                                                        
| 65 | 65 | }  | 
                                                        
| 66 | 66 | |
@@ -69,7 +69,7 @@ discard block  | 
                                                    ||
| 69 | 69 | *  | 
                                                        
| 70 | 70 | * @throws TermStoreException  | 
                                                        
| 71 | 71 | */  | 
                                                        
| 72 | -	public function dropTermsForId( EntityId $id ) { | 
                                                        |
| 72 | +	public function dropTermsForId(EntityId $id) { | 
                                                        |
| 73 | 73 |  		try { | 
                                                        
| 74 | 74 | $this->connection->delete(  | 
                                                        
| 75 | 75 | $this->config->getLabelTableName(),  | 
                                                        
@@ -81,17 +81,17 @@ discard block  | 
                                                    ||
| 81 | 81 | [ 'entity_id' => $id->getSerialization() ]  | 
                                                        
| 82 | 82 | );  | 
                                                        
| 83 | 83 | }  | 
                                                        
| 84 | -		catch ( DBALException $ex ) { | 
                                                        |
| 85 | - throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        |
| 84 | +		catch (DBALException $ex) { | 
                                                        |
| 85 | + throw new TermStoreException($ex->getMessage(), $ex);  | 
                                                        |
| 86 | 86 | }  | 
                                                        
| 87 | 87 | }  | 
                                                        
| 88 | 88 | |
| 89 | -	private function storeLabel( $languageCode, $text, EntityId $id ) { | 
                                                        |
| 89 | +	private function storeLabel($languageCode, $text, EntityId $id) { | 
                                                        |
| 90 | 90 | $this->connection->insert(  | 
                                                        
| 91 | 91 | $this->config->getLabelTableName(),  | 
                                                        
| 92 | 92 | [  | 
                                                        
| 93 | 93 | 'text' => $text,  | 
                                                        
| 94 | - 'text_lowercase' => strtolower( $text ),  | 
                                                        |
| 94 | + 'text_lowercase' => strtolower($text),  | 
                                                        |
| 95 | 95 | 'language' => $languageCode,  | 
                                                        
| 96 | 96 | 'entity_id' => $id->getSerialization(),  | 
                                                        
| 97 | 97 | 'entity_type' => $id->getEntityType()  | 
                                                        
@@ -99,13 +99,13 @@ discard block  | 
                                                    ||
| 99 | 99 | );  | 
                                                        
| 100 | 100 | }  | 
                                                        
| 101 | 101 | |
| 102 | -	private function storeAliases( AliasGroup $aliasGroup, EntityId $id ) { | 
                                                        |
| 103 | -		foreach ( $aliasGroup->getAliases() as $alias ) { | 
                                                        |
| 102 | +	private function storeAliases(AliasGroup $aliasGroup, EntityId $id) { | 
                                                        |
| 103 | +		foreach ($aliasGroup->getAliases() as $alias) { | 
                                                        |
| 104 | 104 | $this->connection->insert(  | 
                                                        
| 105 | 105 | $this->config->getAliasesTableName(),  | 
                                                        
| 106 | 106 | [  | 
                                                        
| 107 | 107 | 'text' => $alias,  | 
                                                        
| 108 | - 'text_lowercase' => strtolower( $alias ),  | 
                                                        |
| 108 | + 'text_lowercase' => strtolower($alias),  | 
                                                        |
| 109 | 109 | 'language' => $aliasGroup->getLanguageCode(),  | 
                                                        
| 110 | 110 | 'entity_id' => $id->getSerialization(),  | 
                                                        
| 111 | 111 | 'entity_type' => $id->getEntityType()  | 
                                                        
@@ -39,8 +39,7 @@ discard block  | 
                                                    ||
| 39 | 39 | |
| 40 | 40 |  		try { | 
                                                        
| 41 | 41 | $this->storeFingerprintParts( $id, $fingerprint );  | 
                                                        
| 42 | - }  | 
                                                        |
| 43 | -		catch ( DBALException $ex ) { | 
                                                        |
| 42 | +		} catch ( DBALException $ex ) { | 
                                                        |
| 44 | 43 | $this->connection->rollBack();  | 
                                                        
| 45 | 44 | throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        
| 46 | 45 | }  | 
                                                        
@@ -80,8 +79,7 @@ discard block  | 
                                                    ||
| 80 | 79 | $this->config->getAliasesTableName(),  | 
                                                        
| 81 | 80 | [ 'entity_id' => $id->getSerialization() ]  | 
                                                        
| 82 | 81 | );  | 
                                                        
| 83 | - }  | 
                                                        |
| 84 | -		catch ( DBALException $ex ) { | 
                                                        |
| 82 | +		} catch ( DBALException $ex ) { | 
                                                        |
| 85 | 83 | throw new TermStoreException( $ex->getMessage(), $ex );  | 
                                                        
| 86 | 84 | }  | 
                                                        
| 87 | 85 | }  | 
                                                        
@@ -11,8 +11,8 @@  | 
                                                    ||
| 11 | 11 | */  | 
                                                        
| 12 | 12 |  class TermStoreException extends \RuntimeException { | 
                                                        
| 13 | 13 | |
| 14 | -	public function __construct( $message, \Exception $previous = null ) { | 
                                                        |
| 15 | - parent::__construct( $message, 0, $previous );  | 
                                                        |
| 14 | +	public function __construct($message, \Exception $previous = null) { | 
                                                        |
| 15 | + parent::__construct($message, 0, $previous);  | 
                                                        |
| 16 | 16 | }  | 
                                                        
| 17 | 17 | |
| 18 | 18 | }  | 
                                                        
| 19 | 19 | \ No newline at end of file  |