<?php namespace Doctrine\DBAL\Platforms\Keywords; use function array_flip; use function array_map; use function strtoupper; /** * Abstract interface for a SQL reserved keyword dictionary. * * @psalm-consistent-constructor */ abstract class KeywordList { /** @var string[]|null */ private ?array $keywords = null; /** * Checks if the given word is a keyword of this dialect/vendor platform. * * @param string $word * * @return bool */ public function isKeyword($word) { if ($this->keywords === null) { $this->initializeKeywords(); } return isset($this->keywords[strtoupper($word)]); } /** @return void */ protected function initializeKeywords() { $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); } /** * Returns the list of keywords. * * @return string[] */ abstract protected function getKeywords(); /** * Returns the name of this keyword list. * * @deprecated * * @return string */ abstract public function getName(); }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
DB2Keywords.php | File | 9.4 KB | 0644 |
|
KeywordList.php | File | 1.11 KB | 0644 |
|
MariaDBKeywords.php | File | 6.12 KB | 0644 |
|
MariaDb102Keywords.php | File | 633 B | 0644 |
|
MySQL57Keywords.php | File | 6.07 KB | 0644 |
|
MySQL80Keywords.php | File | 1.51 KB | 0644 |
|
MySQLKeywords.php | File | 5.96 KB | 0644 |
|
OracleKeywords.php | File | 2.98 KB | 0644 |
|
PostgreSQL100Keywords.php | File | 604 B | 0644 |
|
PostgreSQL94Keywords.php | File | 217 B | 0644 |
|
PostgreSQLKeywords.php | File | 2.85 KB | 0644 |
|
ReservedKeywordsValidator.php | File | 2.91 KB | 0644 |
|
SQLServer2012Keywords.php | File | 232 B | 0644 |
|
SQLServerKeywords.php | File | 4.96 KB | 0644 |
|
SQLiteKeywords.php | File | 3.17 KB | 0644 |
|