hackzilla / password-generator

PHP Library to generate random passwords
https://hackzilla.org
MIT License
293 stars 37 forks source link

something wrong with sample code #1

Closed Rick1125 closed 10 years ago

Rick1125 commented 10 years ago

$generator = new \Hackzilla\PasswordGenerator\Generator\PasswordGenerator(); $generator->setOptions(self::OPTION_UPPER_CASE | self::OPTION_LOWER_CASE | self::OPTION_NUMBERS); $password = $generator->generatePassword();

use 'self' here doesn't work properly, I guess it will be PasswordGenerator::OPTION_UPPER_CASE

and I also think you should "use" the class first before using it, like:

use Hackzilla\PasswordGenerator\Generator\PasswordGenerator as PG;

This is a good library, BTW, save me lots of time from reinvent wheel. Thank you very much.

hackzilla commented 10 years ago

yeah, good point.

Thanks for your feedback.

I've also written a demo app that I haven't yet made mention on in the read me. https://github.com/hackzilla/password-generator-app