PHPackages                             eastoriented/php-block - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. eastoriented/php-block

ActiveLibrary

eastoriented/php-block
======================

A PHP library to emulate Smalltalk block

0301Makefile

Since May 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/eastoriented/php-block)[ Packagist](https://packagist.org/packages/eastoriented/php-block)[ RSS](/packages/eastoriented-php-block/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

eastoriented/php-block [![Build Status](https://camo.githubusercontent.com/5188b82a3bce75ce251968b4046d6db518dae7e52a131450399271ca1c64533d/68747470733a2f2f7472617669732d63692e6f72672f656173746f7269656e7465642f7068702d626c6f636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eastoriented/php-block) [![Coverage Status](https://camo.githubusercontent.com/2a68d97ec4535b819655b33b6b88cfb523e733e63946bb6d4bad204c3e89fd92/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f656173746f7269656e7465642f7068702d626c6f636b2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/eastoriented/php-block?branch=master)
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#eastorientedphp-block--)

`eastoriented/php-block` is a east oriented PHP library to execute block of code using arguments. All public methods in all classes return `void`.

How to use it?
--------------

[](#how-to-use-it)

The file `src/block.php` define the interface `eastoriented\php\block`.
The file `src/block/functor.php` contains a class which implements `eastoriented\php\block` using [PHP callable](http://php.net/callable):

```
use eastoriented\php\block;

(new block\functor(function() { echo 'Hello world!'; }))->blockArgumentsAre(); // display 'Hello world!'
(new block\functor(function($message) { echo $message; }))->blockArgumentsAre('Hello world!'); // display 'Hello world!'
(new block\functor(function($hello, $world) { echo $hello . ' ' . $world . '!'; }))->blockArgumentsAre('Hello', 'world'); // display 'Hello world!'

```

The file `src/block/exception.php` contains a class which implements `eastoriented\php\block` to throw exception:

```
use eastoriented\php\block;

(new block\exception(new \exception))->blockArgumentsAre(); // throw $exception

```

Contributing
------------

[](#contributing)

### About workflow

[](#about-workflow)

We're using pull request to introduce new features and bug fixes.
Please, try to be explicit in your commit messages:

1. Explain why the change was made ;
2. Explain technical implementation (you can provide links to any relevant tickets, articles or other resources).

You can use the following template:

```
# If applied, this commit will...

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

```

To use it, just put it in a text file in (for example) your home and define it as a template:

```
# git config --global commit.template ~/.git_commit_template.txt

```

### About testing

[](#about-testing)

To run unit tests, just do `make unit-tests`.
Moreover, you can executre specific test file using `./bin/php tests/units/src/path/to/file.php`.

Languages and tools
-------------------

[](#languages-and-tools)

- PHP 7.\[1-3\] ;
- [*atoum*](http://docs.atoum.org).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f5d8c29ba579eb1b08a260038385cf0f21752ac8bd13b65fe7c1f4f876a594d?d=identicon)[mageekguy](/maintainers/mageekguy)

---

Top Contributors

[![mageekguy](https://avatars.githubusercontent.com/u/457534?v=4)](https://github.com/mageekguy "mageekguy (20 commits)")

---

Tags

eastoopphp

### Embed Badge

![Health badge](/badges/eastoriented-php-block/health.svg)

```
[![Health](https://phpackages.com/badges/eastoriented-php-block/health.svg)](https://phpackages.com/packages/eastoriented-php-block)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
