Download the PHP package yarco/type-detector without Composer
On this page you can find all versions of the php package yarco/type-detector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yarco/type-detector
More information about yarco/type-detector
Files in yarco/type-detector
Download yarco/type-detector
More information about yarco/type-detector
Files in yarco/type-detector
Vendor yarco
Package type-detector
Short Description TypeDetector is php library to detect variable types by the name and value
License MIT
Package type-detector
Short Description TypeDetector is php library to detect variable types by the name and value
License MIT
Please rate this library. Is it a good library?
Informations about the package type-detector
Type Detector
TypeDetector is php library to detect variable types by the key name and the value. The thinkings inherit from superunit and php-schema ( both are my experimental projects ).
Usage
Use composer to install this library.
composer require yarco/type-detector
Use the class's static method array TypeDetector::detect(array $array)
to get key-value pair of the types.
Example:
Types
Below fields are referenced from w3schools.com.
Number
MySQL Data Types | SQL Server Data Types | HTML Input Types | Doctrine Types | Type Detector Supported |
---|---|---|---|---|
TINYINT(size) | tinyint | |||
SMALLINT(size) | smallint | smallint | smallint | |
MEDIUMINT(size) | ||||
INT(size) | int | range, number | integer | int |
BIGINT(size) | bigint | bigint | bigint | |
FLOAT(size,d) | real | |||
DOUBLE(size,d) | float(n) | float | float | |
DECIMAL(size,d) | decimal(p,s) | decimal | decimal | |
numeric(p,s) | ||||
smallmoney | ||||
money | ||||
bit | boolean |
Text
MySQL Data Types | SQL Server Data Types | HTML Input Types | Doctrine Types | Type Detector Supported |
---|---|---|---|---|
CHAR(size) | char(n), nchar(n) | |||
VARCHAR(size) | varchar(n), nvarchar(n) | text | string | string |
TINYTEXT | ||||
TEXT | text, ntext | textarea | text | text |
BLOB | binary, varbinary | binary | ||
MEDIUMTEXT | ||||
MEDIUMBLOB | ||||
LONGTEXT | ||||
LONGBLOB | image | blob | ||
ENUM(x,y,z,etc.) | select | |||
SET | ||||
password | password | |||
color | color | |||
search | ||||
tel | ||||
url | url |
Datetime
MySQL Data Types | SQL Server Data Types | HTML Input Types | Doctrine Types | Type Detector Supported |
---|---|---|---|---|
DATE | date | date | date | date |
DATETIME | datetime, datetime2, smalldatetime | datetime, datetime-local | datetime | datetime |
TIMESTAMP | timestamp | |||
TIME | time | time | time | time |
YEAR | month,week | |||
datetimeoffset | datetimetz |
Other
MySQL Data Types | SQL Server Data Types | HTML Input Types | Doctrine Types | Type Detector Supported |
---|---|---|---|---|
uniqueidentifier | guid | |||
JSON | checkbox |
Valid Type Definitions
Type Detector Supported Types | Definition | Priority (large first) |
---|---|---|
smallint | type is integer and value less than 100 | 120 |
bigint | type is integer and value large than 10000 | 120 |
int | type is integer | 115 |
decimal | type is float and number of the fraction is either 2 or 3 | 112 |
float | type is float | 110 |
password | type is string and value is *** | 100 |
color | type is string and value match ^#[0-9a-fA-F]{6}$ | 90 |
type is string and value is email | 80 | |
url | type is string and value is url | 70 |
date | type is string and value match ^\d{2}/\d{2}/\d{4}$ or ^\d{4}-\d{2}-\d{2}$ | 60 |
time | type is string and value match ^\d{2}:\d{2}:\d{2}$ or ^\d{2}:\d{2}$ | 60 |
datetime | type is tring and value match ^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}(?::\d{2})?$ or can be convert to datetime | 55 |
string | type is string and length less than 27 | 20 |
text | type is tring | 0 |
All versions of type-detector with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.0
The package yarco/type-detector contains the following files
Loading the files please wait ....