@@ -342,7 +342,7 @@ |
||
342 | 342 | /** |
343 | 343 | * @param array $properties |
344 | 344 | * |
345 | - * @return int|null |
|
345 | + * @return string|null |
|
346 | 346 | * @throws ParserRuntimeException |
347 | 347 | */ |
348 | 348 | protected function getParentPatternId(array &$properties) |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Parser\Sqlite; |
5 | 5 | |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | protected function getTemporaryFileName() : string |
110 | 110 | { |
111 | 111 | if ($this->temporaryFileName === null) { |
112 | - $this->temporaryFileName = $this->getDataDirectory() . DIRECTORY_SEPARATOR . |
|
113 | - 'browscap_' . microtime(true) . '.sqlite'; |
|
112 | + $this->temporaryFileName = $this->getDataDirectory().DIRECTORY_SEPARATOR. |
|
113 | + 'browscap_'.microtime(true).'.sqlite'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return $this->temporaryFileName; |
@@ -181,28 +181,28 @@ discard block |
||
181 | 181 | |
182 | 182 | // Create tables |
183 | 183 | $adapter->exec( |
184 | - 'CREATE TABLE IF NOT EXISTS info (version_id INTEGER PRIMARY KEY ASC, release_time INTEGER NOT NULL, ' . |
|
184 | + 'CREATE TABLE IF NOT EXISTS info (version_id INTEGER PRIMARY KEY ASC, release_time INTEGER NOT NULL, '. |
|
185 | 185 | 'type_id INTEGER NOT NULL, data_hash TEXT NOT NULL)' |
186 | 186 | ); |
187 | 187 | $adapter->exec( |
188 | - 'CREATE TABLE IF NOT EXISTS browser (browser_id INTEGER PRIMARY KEY ASC, browser_parent_id INTEGER, ' . |
|
188 | + 'CREATE TABLE IF NOT EXISTS browser (browser_id INTEGER PRIMARY KEY ASC, browser_parent_id INTEGER, '. |
|
189 | 189 | 'browser_pattern TEXT NOT NULL)' |
190 | 190 | ); |
191 | 191 | $adapter->exec( |
192 | - 'CREATE TABLE IF NOT EXISTS search (browser_id INTEGER PRIMARY KEY ASC, ' . |
|
192 | + 'CREATE TABLE IF NOT EXISTS search (browser_id INTEGER PRIMARY KEY ASC, '. |
|
193 | 193 | 'browser_pattern_length INTEGER NOT NULL, browser_pattern TEXT NOT NULL)' |
194 | 194 | ); |
195 | 195 | |
196 | 196 | $adapter->exec( |
197 | - 'CREATE TABLE IF NOT EXISTS browser_property (browser_property_id INTEGER PRIMARY KEY ASC, ' . |
|
197 | + 'CREATE TABLE IF NOT EXISTS browser_property (browser_property_id INTEGER PRIMARY KEY ASC, '. |
|
198 | 198 | 'browser_id INTEGER NOT NULL, property_key_id INTEGER NOT NULL, property_value_id INTEGER NOT NULL)' |
199 | 199 | ); |
200 | 200 | $adapter->exec( |
201 | - 'CREATE TABLE IF NOT EXISTS browser_property_key (property_key_id INTEGER PRIMARY KEY ASC, ' . |
|
201 | + 'CREATE TABLE IF NOT EXISTS browser_property_key (property_key_id INTEGER PRIMARY KEY ASC, '. |
|
202 | 202 | 'property_key TEXT NOT NULL)' |
203 | 203 | ); |
204 | 204 | $adapter->exec( |
205 | - 'CREATE TABLE IF NOT EXISTS browser_property_value (property_value_id INTEGER PRIMARY KEY ASC, ' . |
|
205 | + 'CREATE TABLE IF NOT EXISTS browser_property_value (property_value_id INTEGER PRIMARY KEY ASC, '. |
|
206 | 206 | 'property_value TEXT NOT NULL)' |
207 | 207 | ); |
208 | 208 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $parentId = $this->parentPatterns[$properties['Parent']]; |
355 | 355 | unset($properties['Parent']); |
356 | 356 | } else { |
357 | - throw new ParserRuntimeException("Parent '" . $properties['Parent'] . "' not found."); |
|
357 | + throw new ParserRuntimeException("Parent '".$properties['Parent']."' not found."); |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | |
@@ -468,15 +468,15 @@ discard block |
||
468 | 468 | // Do NOT use "CREATE TABLE ... AS" here, because this would automatically add an extra id column, |
469 | 469 | // which requires additional space |
470 | 470 | $adapter->exec( |
471 | - 'CREATE TABLE IF NOT EXISTS "search_' . $keywordValue . '" ' . |
|
472 | - '(browser_id INTEGER PRIMARY KEY ASC, browser_pattern_length INTEGER NOT NULL, ' . |
|
471 | + 'CREATE TABLE IF NOT EXISTS "search_'.$keywordValue.'" '. |
|
472 | + '(browser_id INTEGER PRIMARY KEY ASC, browser_pattern_length INTEGER NOT NULL, '. |
|
473 | 473 | 'browser_pattern TEXT NOT NULL)' |
474 | 474 | ); |
475 | 475 | /** @noinspection DisconnectedForeachInstructionInspection */ |
476 | 476 | $adapter->beginTransaction(); |
477 | 477 | $adapter->exec( |
478 | - 'INSERT INTO "search_' . $keywordValue . '" ' . |
|
479 | - 'SELECT browser_id, browser_pattern_length, browser_pattern ' . |
|
478 | + 'INSERT INTO "search_'.$keywordValue.'" '. |
|
479 | + 'SELECT browser_id, browser_pattern_length, browser_pattern '. |
|
480 | 480 | "FROM search WHERE browser_pattern GLOB '*$keywordValue*'" |
481 | 481 | ); |
482 | 482 | $adapter->exec("INSERT INTO keyword VALUES ($keywordId, '$keywordValue')"); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $adapter->commitTransaction(); |
486 | 486 | |
487 | 487 | $adapter->exec( |
488 | - 'CREATE INDEX IF NOT EXISTS i_se' . $keywordId . '_brpale ON "search_' . $keywordValue . |
|
488 | + 'CREATE INDEX IF NOT EXISTS i_se'.$keywordId.'_brpale ON "search_'.$keywordValue. |
|
489 | 489 | '"(browser_pattern_length)' |
490 | 490 | ); |
491 | 491 | |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | protected function cleanUp() |
518 | 518 | { |
519 | 519 | $currentDatabaseFile = basename($this->getTemporaryFileName()); |
520 | - foreach (glob($this->getDataDirectory() . DIRECTORY_SEPARATOR . 'browscap_*.sqlite') as $file) { |
|
520 | + foreach (glob($this->getDataDirectory().DIRECTORY_SEPARATOR.'browscap_*.sqlite') as $file) { |
|
521 | 521 | if (basename($file) !== $currentDatabaseFile) { |
522 | 522 | @unlink($file); |
523 | 523 | } |
@@ -529,6 +529,6 @@ discard block |
||
529 | 529 | */ |
530 | 530 | protected function getLinkPath() : string |
531 | 531 | { |
532 | - return $this->getDataDirectory() . DIRECTORY_SEPARATOR . Parser::LINK_FILENAME; |
|
532 | + return $this->getDataDirectory().DIRECTORY_SEPARATOR.Parser::LINK_FILENAME; |
|
533 | 533 | } |
534 | 534 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Crossjoin\Browscap\Source; |
5 | 5 |