mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-07 13:08:40 +00:00
code fixes
This commit is contained in:
parent
d1edf04232
commit
6805b24820
|
|
@ -84,7 +84,6 @@ abstract class NgramParser
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @phpstan-ignore
|
|
||||||
*/
|
*/
|
||||||
protected function getNgrams(string $str) : array
|
protected function getNgrams(string $str) : array
|
||||||
{
|
{
|
||||||
|
|
@ -102,6 +101,7 @@ abstract class NgramParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
foreach ($tokens as $i => $token) {
|
foreach ($tokens as $i => $token) {
|
||||||
$sum = \array_sum($token);
|
$sum = \array_sum($token);
|
||||||
|
|
||||||
|
|
@ -110,12 +110,14 @@ abstract class NgramParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
if (empty($tokens)) {
|
if (empty($tokens)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$tokens = \array_merge(...$tokens);
|
$tokens = \array_merge(...$tokens);
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
if (isset($tokens['_'])) {
|
if (isset($tokens['_'])) {
|
||||||
unset($tokens['_']);
|
unset($tokens['_']);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -423,6 +423,13 @@ $GLOBALS['dbpool']->create('update', $CONFIG['db']['core']['masters']['update'])
|
||||||
$GLOBALS['dbpool']->create('delete', $CONFIG['db']['core']['masters']['delete']);
|
$GLOBALS['dbpool']->create('delete', $CONFIG['db']['core']['masters']['delete']);
|
||||||
$GLOBALS['dbpool']->create('schema', $CONFIG['db']['core']['masters']['schema']);
|
$GLOBALS['dbpool']->create('schema', $CONFIG['db']['core']['masters']['schema']);
|
||||||
|
|
||||||
|
$GLOBALS['dbpool']->get('admin')->connect();
|
||||||
|
$GLOBALS['dbpool']->get('select')->connect();
|
||||||
|
$GLOBALS['dbpool']->get('insert')->connect();
|
||||||
|
$GLOBALS['dbpool']->get('update')->connect();
|
||||||
|
$GLOBALS['dbpool']->get('delete')->connect();
|
||||||
|
$GLOBALS['dbpool']->get('schema')->connect();
|
||||||
|
|
||||||
DataMapperFactory::db($GLOBALS['dbpool']->get());
|
DataMapperFactory::db($GLOBALS['dbpool']->get());
|
||||||
|
|
||||||
$GLOBALS['frameworkpath'] = '/';
|
$GLOBALS['frameworkpath'] = '/';
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,6 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
$this->model = new BaseModel();
|
$this->model = new BaseModel();
|
||||||
|
|
||||||
var_dump($GLOBALS['dbpool']->get());
|
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `test_base` (
|
'CREATE TABLE `test_base` (
|
||||||
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user