8000 GitHub - castor-labs/context: Context information passing abstraction for PHP
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

castor-labs/context

Repository files navigation

Castor Context

php-workflow code-coverage

Context passing abstraction for modern PHP projects, inspired in Golang's context package.

Installation

composer require castor/context

Quick Start

<?php

use Castor\Context;

// This is a default base context
$ctx = Context\nil();

// This returns a new context with the passed values stored
$ctx = Context\withValue($ctx, 'foo', 'bar');

// Later in the call stack
echo $ctx->value('foo'); // Prints: bar

To learn about the rationale behind this library, best practices when using it and implementation examples, check the documentation.

About

Context information passing abstraction for PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0