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

Commit

Permalink
Merge pull request zendframework/zendframework#2210 from weierophinne…
Browse files Browse the repository at this point in the history
…y/hotfix/remove-suppression-operator

Get rid of error suppression
  • Loading branch information
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Server/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Zend\Json\Server;

use Zend\Server\Cache as ServerCache;
use Zend\Stdlib\ErrorHandler;

/**
* Zend_Json_Server_Cache: cache Zend_Json_Server server definition and SMD
Expand Down Expand Up @@ -38,7 +39,11 @@ public static function saveSmd($filename, Server $server)
return false;
}

if (0 === @file_put_contents($filename, $server->getServiceMap()->toJson())) {
ErrorHandler::start();
$test = file_put_contents($filename, $server->getServiceMap()->toJson());
ErrorHandler::stop();

if (0 === $test) {
return false;
}

Expand All @@ -63,8 +68,11 @@ public static function getSmd($filename)
return false;
}

ErrorHandler::start();
$smd = file_get_contents($filename);
ErrorHandler::stop();

if (false === ($smd = @file_get_contents($filename))) {
if (false === $smd) {
return false;
}

Expand Down

0 comments on commit 52d314b

Please sign in to comment.