Download the PHP package shrink/examples without Composer

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

Examples

Packagist

Compose example objects.

Usage

  1. Install the library with composer
  2. Define examples
  3. Make objects

Install

:yarn: The latest version of Examples requires PHP 8.1, use Examples v1 for PHP 7.4 and PHP 8.0 support.

Instantiate Examples

An Examples::class instance holds your example definitions and creates your objects from these definitions.

Define Examples

The E::define() method accepts a class type and zero or more named arguments, which map to the type's constructor arguments. E::define() returns a definition to register with your instance of Examples.

:sparkles: Since v2, named arguments are used instead of a parameters array.

:dna: E::define() is a shortcut to create a simple example definition, see Internals -> Definition for building your own implementation.

Make An Object

The E::g() method accepts a class type (referring to a registered example) and zero or more named arguments to overwrite the example defaults. E::g() returns an example configuration, which your instance of Examples will make().

:dna: E::g() is a shortcut to create a simple example configuration, see Internals -> Creation for building your own implementation.

Features

Nested Examples

Examples::class will resolve any example definitions it encounters when making an example, allowing for many levels of nested example definitions and configuration.

Internals

Definition

Examples are registered using an example definition (DefinesExample) which in turn uses a builder (BuildsExampleInstances) to create an object using optional configuration.

Implicit instance building is handled through Reflection by ReflectionBuilder which accepts a class name to build.

E::define() is a shortcut for creating an example definition with implicit building. Explicit instance building is handled by providing a callable which is called with the Example parameters as method parameters.

Creation

Objects are made, from an example, with an optional configuration of parameters. Ask the Examples instance to make(ConfiguresExample $configuration). A default implementation of ConfiguresExample is included which is constructed with the type and parameters.

Parameters may be provided to overwrite any defaults.

License

Examples is open-sourced software licensed under the MIT license.


All versions of examples with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 shrink/examples contains the following files

Loading the files please wait ....