Skip to content

Commit

Permalink
Merge e1a8145 into 7641211
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrukowski authored Jul 25, 2022
2 parents 7641211 + e1a8145 commit 40d458f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [4.0.5] - 2022-07-25

* Travis has been removed
* GitHub Actions have been introduced
* Made the `defer` logic more explicit

## [4.0.4] - 2020-06-28

Added test for changing returned value in defer.
Expand All @@ -17,13 +23,14 @@ Added test for changing returned value in defer.

## [4.0.1] - 2020-02-23

Added additional unit test.
Added a test.

## [4.0.0] - 2019-10-21

Order of execution deferred functions has reversed (LIFO as in Golang).
Given version is successor of version [2.0.0].
The order of execution of deferred functions has been reversed (LIFO as in Golang).
The given version is the successor of version [2.0.0].

[4.0.5]: https://github.com/php-defer/php-defer/compare/v4.0.4...v4.0.5
[4.0.4]: https://github.com/php-defer/php-defer/compare/v4.0.3...v4.0.4
[4.0.3]: https://github.com/php-defer/php-defer/compare/v4.0.2...v4.0.3
[4.0.2]: https://github.com/php-defer/php-defer/compare/v4.0.1...v4.0.2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Coverage Status](https://coveralls.io/repos/github/php-defer/php-defer/badge.svg?branch=4.0)](https://coveralls.io/github/php-defer/php-defer?branch=4.0)
[![Tests status](https://github.com/php-defer/php-defer/actions/workflows/tests.yml/badge.svg)](https://github.com/php-defer/php-defer/actions/workflows/tests.yml?query=branch%3A4.0)

A [defer statement](https://blog.golang.org/defer-panic-and-recover) originally comes from Golang. This library allows you to use defer functionality in PHP code.
The [defer statement](https://blog.golang.org/defer-panic-and-recover) originally comes from Golang. This library allows you to use the defer functionality in your PHP code.

## Usage

Expand All @@ -15,7 +15,7 @@ defer($context, $callback);

`defer` requires two parameters: `$context` and `$callback`.

1. `$context` - unused in your app, required to achieve "defer" effect. I recommend to use `$_` always.
1. `$context` - unused in your app, required to achieve the "defer" effect. I recommend to use `$_` always.
2. `$callback` - a callback which is executed after the surrounding function returns.

## Examples
Expand Down

0 comments on commit 40d458f

Please sign in to comment.