Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
Fix InjectStatsIntoRequestListener
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramtamtam committed Jan 17, 2020
1 parent cf8d9c5 commit 29f68b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## v3.0.2

### Fixed

- Mixins in `InjectStatsIntoRequestListener` (functions now not-static)

## v3.0.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN set -xe \
&& apk add --no-cache binutils git curl \
&& apk add --no-cache --virtual .build-deps autoconf pkgconf make g++ gcc \
# install xdebug (for testing with code coverage), but do not enable it
&& pecl install xdebug-2.7.2 \
&& pecl install xdebug-2.9.1 \
&& apk del .build-deps \
&& mkdir /src ${COMPOSER_HOME} \
&& composer global require 'hirak/prestissimo' --no-interaction --no-suggest --prefer-dist \
Expand Down
4 changes: 2 additions & 2 deletions src/Listeners/InjectStatsIntoRequestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public function handle($event): void
$current_time = (float) \microtime(true);
$allocated_memory = (int) \memory_get_usage();

$request::macro(self::REQUEST_TIMESTAMP_MACRO, static function () use ($current_time): float {
$request::macro(self::REQUEST_TIMESTAMP_MACRO, function () use ($current_time): float {
return $current_time;
});

$request::macro(self::REQUEST_ALLOCATED_MEMORY_MACRO, static function () use ($allocated_memory): int {
$request::macro(self::REQUEST_ALLOCATED_MEMORY_MACRO, function () use ($allocated_memory): int {
return $allocated_memory;
});
}
Expand Down

0 comments on commit 29f68b6

Please sign in to comment.