Download the PHP package vjik/cycle-typecast without Composer
On this page you can find all versions of the php package vjik/cycle-typecast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vjik/cycle-typecast
More information about vjik/cycle-typecast
Files in vjik/cycle-typecast
Package cycle-typecast
Short Description Helper of typecast data in Cycle ORM
License BSD-3-Clause
Informations about the package cycle-typecast
Cycle Typecast
The package provides:
Typecaster
that help typecast data in Cycle ORM and abstractTypecastHandler
that used it;AttributeTypecastHandler
that use attributes for typecast data;TypeInterface
that must be implemented by classes used inTypecaster
andAttributeTypecastHandler
;- classes for
DateTimeImmutable
,UUID
,Array
andEnum
types.
Installation
The package could be installed with composer:
General Usage
Attributes
Custom Typecast Handler
Custom Mapper
Types
ArrayToStringType
Entity value: array of strings. For example, ['A', 'B', 'C']
.
Database value: array concatenated into string with delimiter setted in constructor. For example, A,B,C
.
DateTimeImmutableToIntegerType
Entity value: DateTimeImmutable
.
Database value: timestamp as string (example, 1609658768
).
IntegerEnumType
Entity value: integer typed enumeration.
Database value: enumeration value of integer type.
StringEnumType
Entity value: string typed enumeration.
Database value: enumeration value of string type.
UuidStringToBytesType
Entity value: string standard representation of the UUID. For example, 1f2d3897-a226-4eec-bd2c-d0145ef25df9
.
Database value: binary string representation of the UUID.
Testing
Unit Testing
The package is tested with PHPUnit. To run tests:
Mutation Testing
The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:
Static Analysis
The code is statically analyzed with Psalm. To run static analysis:
License
The Cycle Typecast is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.