Skip to content

Commit

Permalink
Extend description of Column::typecast field (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
roquie authored Jan 18, 2022
1 parent 67f3093 commit 9a023a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"require": {
"php": ">=8.0",
"spiral/tokenizer": "^2.8",
"cycle/orm": "^2.0.0",
"cycle/schema-builder": "^2.1.0",
"doctrine/annotations": "^1.13",
"spiral/attributes": "^2.8",
Expand Down
8 changes: 6 additions & 2 deletions src/Annotation/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Cycle\Annotated\Annotation;

use Cycle\ORM\Parser\Typecast;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\Annotation\Target;
use JetBrains\PhpStorm\ExpectedValues;
Expand All @@ -28,8 +29,11 @@ final class Column
* @param bool $primary Explicitly set column as a primary key.
* @param bool $nullable Set column as nullable.
* @param mixed|null $default Default column value.
* @param non-empty-string|null $typecast Column typecast function.
* Defaults to one of (int|float|bool|datetime) based on column type
* @param non-empty-string|null $typecast Typecast rule name.
* Regarding the default Typecast handler {@see Typecast} the value can be `callable` or
* one of ("int"|"float"|"bool"|"datetime") based on column type.
* If you want to use another rule you should add in the `typecast` argument of the {@see Entity} attribute
* a relevant Typecast handler that supports the rule.
* @param bool $castDefault
*/
public function __construct(
Expand Down

0 comments on commit 9a023a2

Please sign in to comment.