Download the PHP package nayjest/builder without Composer

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

Builder

PHP package for constructing objects using configurations.

Codacy Badge Code Climate Scrutinizer Code Quality Code Coverage Build Status Latest Stable Version Dependency Status

SensioLabsInsight

1. Requirements

This package is not tested with outdated versions of PHP.

If you need to use nayjest/builder in environments with php <= 5.3, test it on your own.

2. Installation

The recommended way of installing the component is through Composer.

Run following command:

3. Overview

3.1 Purpose

Building complex objects from configurations in architecturally beutiful way.

3.2 Explanation

If you are confident with builder design pattern, this package allows you to create builders for your classes in declarative style, based on build configuration.

3.3 Usage

3.3.1 Class Blueprints

When you need to construct objects of some type, first of all, you will create blueprint for that type. In terminology of this package blueprint specifies how to construct object of some specified type. It stores class name and set of build instructiuons.

3.3.2 Builders

Next, you will instantiate a builder with previously created blueprint as constructor argument. In terminology of this package, builder is a instance of Nayjest\Builder\Builder class, initialized with a blueprint of constructed class. This object has public build($input) method that accepts constructed class configurations, builds instance and returns it.

Builders are suitable for reusing. You can build multiple objects specified by same blueprint using same builder.

3.3.3 Scaffold and Instructions

During taget object building, builder creates temporary object, called scaffold. Scaffold contains all information needed to build object (input config, class name, constructor arguments, target instance when it's ready).

This class is importand since all build instructions works with scaffold, scaffold provides interface for accessing all required data to instructions.

And finally, instructions. In terminology of this package, instruction is an instance of class that implements Nayjest\Builder\Instructions\Base\InstructionInterface and can modify data inside scaffold.

There is a set of predefined instructions, but you can create your own (the dirty way is usage of Nayjest\Builder\Instructions\Base\Instruction\CustomInstruction initialized by user function that will perform operations you want).

Also, instantiating target object and setting public properties or properties that has setters with corresponding names in camel case (i.e. setSomeAttribute($val) for 'some_attribute' input field) does not requires specific instruction in class blueprint, it's operations, performed by default.

4. Build Instructions

Nayjest\Builder\Instructions\CustomInstruction

Applies user function to scaffold.

Nayjest\Builder\Instructions\SetValue

Can be used to specify default values in build configuration or overwrite existing.

Nayjest\Builder\Instructions\Remove

Removes value from input configuration if exists.

Nayjest\Builder\Instructions\Mapping\Build

Replaces value by object builded using specified class blueprint.

Nayjest\Builder\Instructions\Mapping\BuildChildren

Replaces array elements inside target field by objects builded using specified class blueprint.

Nayjest\Builder\Instructions\Mapping\ClassName

Uses value in specified field as target class name.

Nayjest\Builder\Instructions\Mapping\ConstructorArgument

Uses value in specified field as constructor argument.

Nayjest\Builder\Instructions\Mapping\CustomMapping

Applies user function to specified field.

Nayjest\Builder\Instructions\Mapping\Rename

Renames specified field inside input configuration.

5. Testing

Run following command:

6. License

© 2014 — 2015 Vitalii Stepanenko

Licensed under the MIT License.

Please see License File for more information.


All versions of builder with dependencies

PHP Build Version
Package Version
Requires nayjest/manipulator Version ^3
php Version >=5.4.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 nayjest/builder contains the following files

Loading the files please wait ....