nubs/random-name-generator

cinam/randomizer is a dev dependency?

Closed this issue · 2 comments

Hey thanks for making this library! Is there any reason cinam/randomizer is specifically a dev dependency? From the composer docs:

require-dev: Lists packages required for developing this package, or running tests, etc.

When I try to use the package I'm getting an error that cinam/randomizer isn't found, which makes sense since it's not listed as a dependency :)

nubs commented

I was able to use the package without installing cinam/randomizer just fine. I am running php 5.6, but it should work in any PHP version, I believe. I put together a sample gist to show this project in action. You can test it out on your box by running the following (or something similar if you are running Windows):

git clone https://gist.github.com/8d1078440ec7c651898e.git
cd 8d1078440ec7c651898e
composer install
php test.php

The cinam/randomizer is not meant to be a strong dependency. The code should work without it. It's only used to provide a way to alter the random number generation if using array_rand is not sufficient. In particular, I did this so I could write deterministic tests for checking the "random" names generated by the library.

If you are still having issues, please follow up with some additional details including OS, PHP version, and if possible a reproducible test case. Thanks for trying out my project and for your bug report.

Oh, my bad. I didn't realize you could typehint and still pass through a null value here https://github.com/nubs/random-name-generator/blob/master/src/Alliteration.php#L26

Thanks for the quick response