Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ composer.lock
# phpunit
.phpunit.result.cache
phpunit.tdx

#tests
/tests/Sample/Integration/Condition
/tests/Sample/Integration/Dao
/tests/Sample/Integration/Property
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@
"ext-pdo": "*"
},
"require-dev": {
"php": "^7.3",
"phpunit/phpunit": "^8.4",
"nunomaduro/phpinsights": "^v1.13"
"php": "^8.1",
"phpunit/phpunit": "^9.5",
"nunomaduro/phpinsights": "^v2.0"
},
"autoload": {
"psr-4": {
"Citrus\\": "src/",
"Test\\": "tests/"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
5 changes: 3 additions & 2 deletions src/Database/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function property(string $class_prefix, string $table_name): void
// コメント
$comment = (true === array_key_exists($column_name, $comments) ? $comments[$column_name]->comment : '');
// プロパティ追加
$klass->addProperty(new KlassProperty($data_type, $column_name, null, $comment));
$klass->addProperty(new KlassProperty('?' . $data_type, $column_name, 'null', $comment));
}

$generate_class_path = sprintf('%s/Property/%s.php', $output_dir, $class_name);
Expand Down Expand Up @@ -282,6 +282,7 @@ private static function convertToPHPType(string $data_type): string
case 'text':
case 'date':
case 'timestamp without time zone':
case 'timestamp with time zone':
// 文字列
$data_type = 'string';
break;
Expand All @@ -292,7 +293,7 @@ private static function convertToPHPType(string $data_type): string
break;
case 'numeric':
// 浮動小数点
$data_type = 'double';
$data_type = 'float';
break;
default:
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sqlmap/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class Client extends Executor
{
/** @var string SQLMAPのパス */
protected $sqlmap_path;
protected string $sqlmap_path;



Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Catalog/CatalogManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function 生成したテーブル情報が取得できる()
{
if ('user_id' === $column_name)
{
$this->assertSame('int', $tableColumn->data_type);
$this->assertSame('INT', $tableColumn->data_type);
}
else if ('name' === $column_name)
{
Expand Down