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

Commit

Permalink
Merge branch 'hotfix/1' into develop
Browse files Browse the repository at this point in the history
Forward port #1
  • Loading branch information
weierophinney committed Jul 6, 2015
2 parents d0fc9fc + c805b77 commit 622280b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -40,3 +40,6 @@ All notable changes to this project will be documented in this file, in reverse
- [#4](https://github.com/zendframework/zend-log/pull/4) adds better, more
complete verbiage to the `composer.json` `suggest` section, to detail why
and when you might need additional dependencies.
- [#1](https://github.com/zendframework/zend-log/pull/1) updates the code to
remove conditionals related to PHP versions prior to PHP 5.5, and use bound
closures in tests (not possible before 5.5).
6 changes: 1 addition & 5 deletions src/Processor/Backtrace.php
Expand Up @@ -66,10 +66,6 @@ public function process(array $event)
*/
protected function getBacktrace()
{
if (PHP_VERSION_ID >= 50400) {
return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $this->traceLimit);
}

return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $this->traceLimit);
}
}
4 changes: 1 addition & 3 deletions src/Processor/RequestId.php
Expand Up @@ -53,9 +53,7 @@ protected function getIdentifier()
return $this->identifier;
}

$requestTime = (PHP_VERSION_ID >= 50400)
? $_SERVER['REQUEST_TIME_FLOAT']
: $_SERVER['REQUEST_TIME'];
$requestTime = $_SERVER['REQUEST_TIME_FLOAT'];

if (Console::isConsole()) {
$this->identifier = md5($requestTime);
Expand Down
3 changes: 0 additions & 3 deletions test/LoggerAwareTraitTest.php
Expand Up @@ -12,9 +12,6 @@
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Log\Logger;

/**
* @requires PHP 5.4
*/
class LoggerAwareTraitTest extends TestCase
{
public function testSetLogger()
Expand Down
10 changes: 4 additions & 6 deletions test/LoggerTest.php
Expand Up @@ -457,9 +457,8 @@ public function testRegisterFatalShutdownFunction()
// check for single error handler instance
$this->assertFalse(Logger::registerFatalErrorShutdownFunction($this->logger));

$self = $this;
register_shutdown_function(function () use ($writer, $self, &$caught) {
$self->assertEquals(
register_shutdown_function(function () use ($writer) {
$this->assertEquals(
'Call to undefined method ZendTest\Log\LoggerTest::callToNonExistingMethod()',
$writer->events[0]['message']
);
Expand Down Expand Up @@ -489,9 +488,8 @@ public function testRegisterFatalErrorShutdownFunctionHandlesCompileTimeErrors()
// check for single error handler instance
$this->assertFalse(Logger::registerFatalErrorShutdownFunction($this->logger));

$self = $this;
register_shutdown_function(function () use ($writer, $self, &$caught) {
$self->assertStringMatchesFormat(
register_shutdown_function(function () use ($writer) {
$this->assertStringMatchesFormat(
'syntax error%A',
$writer->events[0]['message']
);
Expand Down

0 comments on commit 622280b

Please sign in to comment.