Skip to content

Commit e5e6625

Browse files
committed
Updating comments for deprecations.
The `@todo` tag is used for internal messages for developers maintaining the library and the class, explaining that (and why) it should be removed in a future version. The `@deprecated` tag is intended for the eyes of someone using this library to tell them that the method is deprecated and giving an alternative suggestion.
1 parent 2ee300f commit e5e6625

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Robin/Ntlm/Crypt/Random/McryptRandomByteGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
namespace Robin\Ntlm\Crypt\Random;
1010

1111
use Robin\Ntlm\Crypt\Exception\CryptographicFailureException;
12-
use UnexpectedValueException;
1312

1413
/**
1514
* A cryptographically secure random byte generator implemented using the PHP
1615
* "mcrypt" extension.
1716
*
1817
* @link http://php.net/mcrypt
1918
* @deprecated This implementation is deprecated, as the mcrypt library
20-
* is abandoned. More info: https://github.com/robinpowered/php-ntlm/pull/1
21-
* @todo Remove this implementation in a future version.
19+
* is abandoned. Use {@link NativeRandomByteGenerator} instead.
20+
* More info: https://github.com/robinpowered/php-ntlm/pull/1
21+
* @todo Mcrypt is abandoned and this should be removed in a future version.
2222
*/
2323
class McryptRandomByteGenerator implements RandomByteGeneratorInterface
2424
{
@@ -68,7 +68,7 @@ public function __construct($source = self::DEFAULT_SOURCE)
6868
* {@inheritDoc}
6969
*
7070
* @deprecated This implementation is deprecated, as the mcrypt
71-
* library is abandoned.
71+
* library is abandoned. Use {@link NativeRandomByteGenerator} instead.
7272
*/
7373
public function generate($size)
7474
{

src/Robin/Ntlm/Crypt/Random/OpenSslRandomByteGenerator.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
* "openssl" extension.
1616
*
1717
* @link http://php.net/openssl
18-
* @deprecated Insecure! This implementation is deprecated, as it's been found to
19-
* be insecure. More info: https://github.com/robinpowered/php-ntlm/issues/7
20-
* @todo Remove this implementation in a future version.
18+
* @deprecated This implementation is deprecated, as it's been found to
19+
* be insecure. Use {@link NativeRandomByteGenerator} instead.
20+
* More info: https://github.com/robinpowered/php-ntlm/issues/7
21+
* @todo This random byte generator is insecure due to an issue with
22+
* `openssl_random_pseudo_bytes`. It should be removed in a future version.
2123
*/
2224
class OpenSslRandomByteGenerator implements RandomByteGeneratorInterface
2325
{
@@ -29,8 +31,8 @@ class OpenSslRandomByteGenerator implements RandomByteGeneratorInterface
2931
/**
3032
* {@inheritDoc}
3133
*
32-
* @deprecated Insecure! This implementation is deprecated, as it's been found
33-
* to be insecure.
34+
* @deprecated This implementation is deprecated, as it's been found
35+
* to be insecure. Use {@link RandomByteGeneratorInterface} instead.
3436
*/
3537
public function generate($size)
3638
{

0 commit comments

Comments
 (0)