diff --git a/composer.json b/composer.json index 9fd40ec..d14de0c 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ ], "require": { "php": ">=8.1", + "cycle/database": "^2.15", "cycle/orm": "^2.9.2", "cycle/schema-builder": "^2.11.1", "spiral/attributes": "^2.8|^3.0", diff --git a/src/Annotation/Column.php b/src/Annotation/Column.php index aec7a99..cf5aad8 100644 --- a/src/Annotation/Column.php +++ b/src/Annotation/Column.php @@ -51,7 +51,7 @@ public function __construct( #[ExpectedValues(values: ['primary', 'bigPrimary', 'enum', 'boolean', 'integer', 'tinyInteger', 'smallInteger', 'bigInteger', 'string', 'text', 'tinyText', 'longText', 'double', 'float', 'decimal', 'datetime', 'date', 'time', 'timestamp', 'binary', 'tinyBinary', 'longBinary', 'json', - 'uuid', 'bit', + 'snowflake', 'ulid', 'uuid', 'bit', // PostgreSQL 'smallPrimary', 'timetz', 'timestamptz', 'interval', 'bitVarying', 'int4range', 'int8range', 'numrange', 'tsrange', 'tstzrange', 'daterange', 'jsonb', 'point', 'line', 'lseg', 'box', 'path', 'polygon', 'circle', diff --git a/tests/Annotated/Fixtures/Fixtures26/City.php b/tests/Annotated/Fixtures/Fixtures26/City.php index ee0c6d0..ce13a29 100644 --- a/tests/Annotated/Fixtures/Fixtures26/City.php +++ b/tests/Annotated/Fixtures/Fixtures26/City.php @@ -13,13 +13,13 @@ private function __construct(string $value) $this->value = $value; } - public function __toString(): string + public static function fromString(string $value): self { - return $this->value; + return new self($value); } - public static function fromString(string $value): self + public function __toString(): string { - return new self($value); + return $this->value; } } diff --git a/tests/Annotated/Fixtures/Fixtures26/CityTypecast.php b/tests/Annotated/Fixtures/Fixtures26/CityTypecast.php index bdc8d8c..373526d 100644 --- a/tests/Annotated/Fixtures/Fixtures26/CityTypecast.php +++ b/tests/Annotated/Fixtures/Fixtures26/CityTypecast.php @@ -43,7 +43,7 @@ public function uncast(array $data): array continue; } - $data[$column] = (string)$value; + $data[$column] = (string) $value; } return $data;