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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package type-detector

Type Detector

Latest Version Build Status Total Downloads

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
email email
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
email 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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yarco/type-detector contains the following files

Loading the files please wait ....