Hamlet Framework / HTTP / Request

0.0.4 2021-01-09 06:10 UTC

This package is auto-updated.

Last update: 2021-05-10 11:51:17 UTC


Build Status

This library generally provides you with three ways of creating objects.

Step-wise adjustments

The standard approach is to create an object through a series of adjustments.

$message = Message::empty()
    ->withHeader('Host', 'example.net');

Note, that all with* methods are validating and in the example above we're creating 2 intermediate objects along the way.

Validating builders

We can avoid creating multiple objects by using a validating builder

$message = Message::validatingBuilder()

It offers the same level of validation as the previous method.

Non-validating builders

When creating messages within you application's secure boundaries, there is a way to avoid redundant argument validation by using non-validating builders

$message = Message::nonValidatingBuilder()

When in doubt use validating builders.

Outstanding tasks