Download the PHP package diskerror/typed without Composer

On this page you can find all versions of the php package diskerror/typed. 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 typed

Typed Classes and Objects

Updates for PHP8 (>=8.1).

This enables PHP objects to strictly define member structure, to control their data types, and to add convenience methods. The master branch is considered to be in constant development and currently only supports PHP version 8.1 and above, and now handles strict typing and allows for properties with class typing to be set to null.

Object properties with public visibility will only use the built-in PHP type checking. Making the visibility protected or private will force the setting of values through the Diskerror\Typed mechanism. This mechanism silently ignores bad or unmapped property names and silently coerces input data into the best form represented by the property data type. Assigning the wrong data type to public properties will throw an exception.

TypedAbstract

Abstract Methods

assign

Child class will copy all matching members by name while maintaining original types and doing a deep copy where appropriate. This method will silently ignore extra properties in the input object, and will skip names starting with an underscore (per Zend Framework coding style). EXCEPT: the property name "_id" is allowed for use with MongoDB.

Input can be an object or an array, null, or false. A null or false will set the TypedAbstract object to zero or empty values.

merge

This method is similar to assign above except that it clones the current object and then replaces matching values with the input values and returns the new TypedAbstract object.

Implemented Methods

clear

Sets all members to null, zero, or empty. Objects will also have their members set to null, zero, or empty.

toArray

Returns an associative array of this object with only the appropriate members, according to the toArrayOptions setting. A deep copy/conversion to an associative array from objects is also performed.

jsonSerialize

This method will return an array when json_encode is called on the object. This will have the options to omit empty values and maintain expressions.

_setBasicTypeAndConfirm

This static method references the input value and casts it to the basic requested type.

TypedClass

The derivatives of TypedClass are contracted to do these things:

The users' class properties must be declared as "protected" or "private" for this contract to work. The names for the properties must follow the naming convention that the intended "public" members must not start with an underscore. This borrows from the Zend Framework property naming convention of protected and private property names starting with an underscore.

If a non-public property has no type then it is assumed to accept any type and null values. If a property has no type but has been assigned an initial value then the type will be assumed to be of the initial value.

Even more complex examples can be found int the "tests" directory.

TypedArray

The instances or derivatives of TypedArray are contracted to do these things:

DateTime and Date

These classes add convenience methods to the built-in PHP DateTime class. This includes the __toString method that returns a date-time string formatted for the initValue MySQL date-time format.

SqlStatement

Utility class that outputs properly formatted partial SQL strings based on the input data. Both accept an input array, and an array where the values are the names of members to include from the first array. An empty array means to use all members.

toInsert

Returns a string formatted for an SQL INSERT or UPDATE statement. Accepts an array where the values are the names of members to include. An empty array means to use all members.

toValues

Returns a string formatted for an SQL "ON DUPLICATE KEY UPDATE" statement.

Composer


All versions of typed with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
ext-intl Version *
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 diskerror/typed contains the following files

Loading the files please wait ....