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

Commit 8462cde

Browse files
committed
Get rid of error suppression
- Thanks to intiilapa (Benoit Durand) - grep -r "@" library/Zend/ | grep -v "*" | grep -v "// @" used to identify suppressions - Used ErrorHandler to remove suppressions

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Adapter/Digest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace Zend\Authentication\Adapter;
1212

1313
use Zend\Authentication\Result as AuthenticationResult;
14+
use Zend\Stdlib\ErrorHandler;
1415

1516
/**
1617
* @category Zend
@@ -169,7 +170,10 @@ public function authenticate()
169170
}
170171
}
171172

172-
if (false === ($fileHandle = @fopen($this->filename, 'r'))) {
173+
ErrorHandler::start(E_WARNING);
174+
$fileHandle = fopen($this->filename, 'r');
175+
ErrorHandler::stop();
176+
if (false === $fileHandle) {
173177
throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading");
174178
}
175179

src/Adapter/Http/FileResolver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace Zend\Authentication\Adapter\Http;
1212

13+
use Zend\Stdlib\ErrorHandler;
14+
1315
/**
1416
* HTTP Authentication File Resolver
1517
*
@@ -102,7 +104,9 @@ public function resolve($username, $realm, $password = null)
102104
}
103105

104106
// Open file, read through looking for matching credentials
105-
$fp = @fopen($this->file, 'r');
107+
ErrorHandler::start(E_WARNING);
108+
$fp = fopen($this->file, 'r');
109+
ErrorHandler::stop();
106110
if (!$fp) {
107111
throw new Exception\RuntimeException('Unable to open password file: ' . $this->file);
108112
}

0 commit comments

Comments
 (0)