AthenaeumAthenaeum
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
  • Version 5.x

    • Release Notes
    • Upgrade Guide
    • New to this...
    • Origin
  • ACL

    • Introduction
    • How to install
    • Setup
    • Permissions
    • Roles
    • Users
    • Cached Permissions
  • Circuits

    • Circuits
    • How to install
    • Setup
    • Usage
    • Events
  • Collections

    • Collections
    • How to install
    • Summation

      • Summation Collection
      • Items Processor
  • Config

    • Configuration Loader
    • How to install
    • Setup
    • Load Configuration Files
    • Custom File Parsers
  • Console

    • Command and Schedule Registration
    • How to install
    • Setup
    • Commands
    • Schedules
  • Container

    • IoC Service Container
    • How to install
    • Container
    • List Resolver
  • Core

    • Athenaeum Core Application
    • Prerequisite
    • How to install
    • Integration
    • Usage

      • Configuration
      • Service Providers
      • Service Container
      • Events
      • Caching
      • Logging
      • Console
      • Task Scheduling
      • Exception Handling
      • Extending Core Application
      • Testing
  • Database

    • Introduction
    • How to install
    • Models

      • Instantiatable
      • Sluggable
    • Query

      • Criteria (Query Filter)
  • Dto

    • Data Transfer Object (DTO)
    • How to install
    • Create Interface
    • Implement DTO
    • How to use
    • Populate
    • Export
    • Json
    • Serialization
    • Nested DTOs
    • Array DTO
  • Events

    • Register Listeners and Subscribers
    • How to install
    • Setup
    • Listeners
    • Subscribers
  • Filters

    • Search Filter Utilities
    • Prerequisites
    • How to install
    • Setup
    • Processor
    • Filters Builder
    • Predefined Resources

      • Search Processor
      • Sorting Processor
      • Constraints Processor
      • Matching Processor
    • Tip: Create a base builder
  • Http

    • Clients

      • Http Clients
      • How to install
      • Setup
      • Basic Usage
      • Available Methods

        • Fluent Api
        • Protocol Version
        • Base Uri
        • Http Method and Uri
        • Headers
        • Accept & Content-Type
        • Authentication
        • Http Query
        • Payload Format
        • Payload
        • Attachments
        • Cookies
        • Response Expectations
        • Middleware
        • Conditions
        • Criteria
        • Redirects
        • Timeout
        • Debugging
        • Logging
        • Driver Options
        • Driver
      • Http Query Builder

        • Introduction
        • Select
        • Where
        • Dates
        • Include
        • Pagination
        • Sorting
        • Raw Expressions
        • Custom Grammar
    • Cookies

      • Http Cookies
      • How to install
      • Usage
    • Messages

      • Http Messages
      • How to install
      • Serializers
  • Properties

    • Properties Overload
    • How to install
    • Usage
    • Naming Convention
    • Properties Visibility
  • Redmine

    • Redmine Api Client
    • How to install
    • Setup
    • General Usage

      • Supported Operations
      • Fetch list of resources
      • Find
      • Fetch
      • Create new record
      • Update existing record
      • Delete existing record
      • Relations
    • Available Resources

      • Predefined Resources
      • Attachments
      • Enumerations
      • Issue Relations
      • Users
      • User Groups
      • Roles
      • Project Memberships
      • Versions (Milestones)
      • Issue Categories
      • Trackers
  • Service

    • Service Registrar
    • How to install
    • How to use
  • Support

    • Introduction
    • How to install
    • Laravel Aware-of Helpers

      • How to use
      • Enforce Via Interface
      • Custom Default
      • Pros and Cons
      • Available Helpers
    • Aware-of Properties

      • Generator
      • Available Aware-of Helpers
    • Live Templates
  • Testing

    • Introduction
    • How to install
    • Test Cases
    • Testing Aware-of Helpers
  • Utils

    • Introduction
    • How to install
    • Array
    • Duration
    • Json
    • Math
    • Method Helper
    • Populatable
    • Version
  • Validation

    • Introduction
    • How to install
    • Setup
    • Rules

      • Alpha-Dash-Dot
You are viewing documentation for an outdated version. It is no longer supported!

Release Notes

v5.x Highlights

These are the new features and additions of Athenaeum v5.x.

  • v5.x Highlights
    • Http Client Middleware
    • Extract Response Expectations
    • Debugging Request and Response
    • Default otherwise callback
    • Support for TOML configuration files
    • Resolve list of dependencies
    • Http Messages Package
    • Duration
    • Upgraded Dependencies
  • Changelog

Http Client Middleware

You can now assign middleware to process your outgoing requests and incoming responses. See Http Client Middleware for more examples.

use Acme\Middleware\MeasuresResponseTime;

$response = $client
        ->withMiddleware(new MeasuresResponseTime())
        ->get('/weather');

Extract Response Expectations

A ResponseExpectations class has been added, which you can use as a base class to extract complex expectations into separate classes. See documentation for additional information.

use Aedart\Http\Clients\Requests\Builders\Expectations\ResponseExpectation;
use Aedart\Contracts\Http\Clients\Responses\Status;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

class UserWasCreated extends ResponseExpectations
{
    public function expectation(
        Status $status,
        ResponseInterface $response,
        RequestInterface $request
    ): void {
        // ...validation not shown here...
    }
}

// --------------------------------------- /
// Use expectation when you send your request
$response = $client
        ->expect(new UserWasCreated())
        ->post('/users', [ 'name' => 'John Snow' ]);

Debugging Request and Response

Debugging and logging utilities have been added for a quick way to dump outgoing request and incoming response.

// Dump request / response.
$response = $client
        ->debug()
        ->get('/users');

// --------------------------------------------

// Logs the request / response.
$response = $client
        ->log()
        ->get('/users');

Default otherwise callback

The Circuit Breaker now supports setting a default "otherwise" callback, via the otherwise() method. When no "otherwise" callback is provided to the attempt() method, the default "otherwise" callback will be used.

use Aedart\Contracts\Circuits\CircuitBreaker;

$result = $circuitBreaker
    ->otherwise(function(CircuitBreaker $cb) {
        // ...not shown...
    })
    ->attempt(function(CircuitBreaker $cb) {
        // ...callback not shown...
    });

Support for TOML configuration files

Added configuration file parser for TOML format, for the configuration loader.

Resolve list of dependencies

Using the new ListResolver, you can resolve a list of dependencies, including custom arguments. (Component is available in the Service Container package).

use Aedart\Container\ListResolver;

$list = [
    \Acme\Filters\SanitizeInput::class,
    \Acme\Filters\ConvertEmptyToNull::class,
    \Acme\Filters\ApplySorting::class => [
        'sortBy' => 'age',
        'direction' => 'desc'
    ]
];

// Resolve list of dependencies
$filters = (new ListResolver())->make($list);

Http Messages Package

A new package for that offers PSR-7 Http Messages utilities. See documentation for additional information.

Duration

Added Duration utility; a small component able to help with dealing with relative date and time. See utilities for more information.

Upgraded Dependencies

Upgraded several dependencies, here amongst Laravel which is now running on v8.x.

Changelog

Make sure to read the changelog for additional information about the latest release, new features, changes and bug fixes.

Edit page
Last Updated: 05/04/2022, 21:01
Contributors: Alin Eugen Deac
Next
Upgrade Guide