From 9ad8a02c542603337672fa337a9a2ee57bf203b1 Mon Sep 17 00:00:00 2001 From: scrs_zdenek Date: Wed, 31 Jan 2024 09:00:47 +0100 Subject: [PATCH] dev --- src/Drago/Generator/Attribute.php | 25 ------------------- src/Drago/Generator/Base.php | 2 +- .../Generator/DataClassGenerator.php | 2 +- .../Generator/Generator/EntityGenerator.php | 6 ++--- src/Drago/Generator/Options.php | 8 +++--- src/Drago/Generator/Type.php | 25 ------------------- 6 files changed, 9 insertions(+), 59 deletions(-) delete mode 100644 src/Drago/Generator/Attribute.php delete mode 100644 src/Drago/Generator/Type.php diff --git a/src/Drago/Generator/Attribute.php b/src/Drago/Generator/Attribute.php deleted file mode 100644 index aa2329a..0000000 --- a/src/Drago/Generator/Attribute.php +++ /dev/null @@ -1,25 +0,0 @@ -setPublic(); // Add to constant column length information. - if ($options->constantLengthDataClass) { + if ($options->constantSizeDataClass) { if (!$attr->isAutoIncrement() && $attr->getSize() > 0) { $class->addConstant($constant . 'Size', $attr->getSize()) ->setPublic(); diff --git a/src/Drago/Generator/Generator/EntityGenerator.php b/src/Drago/Generator/Generator/EntityGenerator.php index 4a5b3a2..1d859c7 100644 --- a/src/Drago/Generator/Generator/EntityGenerator.php +++ b/src/Drago/Generator/Generator/EntityGenerator.php @@ -107,8 +107,8 @@ public function createPhpFile(string $table): void ->setPublic(); } - // Add to constant column length information - if ($options->constantLength) { + // Add to constant column size information + if ($options->constantSize) { if (!$attr->isAutoIncrement() && $attr->getSize() > 0) { $class->addConstant($constant . 'Size', $attr->getSize()) ->setPublic(); @@ -123,7 +123,7 @@ public function createPhpFile(string $table): void if ($attr->isAutoIncrement()) { $create = $class->addProperty($column) ->setType($detectType) - ->setNullable(true) + ->setNullable() ->setPublic(); } else { diff --git a/src/Drago/Generator/Options.php b/src/Drago/Generator/Options.php index 51b6db8..231abac 100644 --- a/src/Drago/Generator/Options.php +++ b/src/Drago/Generator/Options.php @@ -43,8 +43,8 @@ class Options /** Add the name before the constant. */ public string|null $constantPrefix = null; - /** Allow constant column length. */ - public bool $constantLength = false; + /** Allow constant column size. */ + public bool $constantSize = false; /** Allow table references in the property */ public bool $references = false; @@ -72,8 +72,8 @@ class Options /** Allow constant. */ public bool $constantDataClass = true; - /** Allow constant column length. */ - public bool $constantLengthDataClass = true; + /** Allow constant column size. */ + public bool $constantSizeDataClass = true; /** Add the name before the constant. */ public string|null $constantDataPrefix = null; diff --git a/src/Drago/Generator/Type.php b/src/Drago/Generator/Type.php deleted file mode 100644 index bc9d985..0000000 --- a/src/Drago/Generator/Type.php +++ /dev/null @@ -1,25 +0,0 @@ -