Dropped HHVM reference, misc. cleanup

This commit is contained in:
Josh Sherman 2019-01-02 23:34:34 -06:00
parent 099b421d0d
commit 405b5a404d
No known key found for this signature in database
GPG key ID: 55B058A80530EF22

View file

@ -4,36 +4,35 @@
[![Coverage Status](https://coveralls.io/repos/github/joshtronic/php-loremipsum/badge.svg?branch=master)](https://coveralls.io/github/joshtronic/php-loremipsum?branch=master)
[![Total Downloads](https://poser.pugx.org/joshtronic/php-loremipsum/downloads)](https://packagist.org/packages/joshtronic/php-loremipsum)
Lorem ipsum generator in PHP without dependencies. Compatible with PHP 5.3+ as
well as HHVM.
Lorem ipsum generator in PHP without dependencies. Compatible with PHP 5.3+.
## Origins
Once upon a time, I was attempting to find a lorem ipsum generator over on
[Packagist](https://packagist.org/search/?q=lorem%20ipsum). I was presented
with many options, and some of those options were good. Unfortunately, the
bulk of those options depended on Symphony or the Zend Framework. This
wouldnt have been a big deal but under the circumstances, I wanted something
that was not tightly coupled to these frameworks because I wanted to use the
generator in my _own_ framework.
[Packagist](https://packagist.org/search/?q=lorem%20ipsum). I was presented with
many options, and some of those options were good. Unfortunately, the bulk of
those options depended on Symphony or the Zend Framework. This wouldnt have
been a big deal but under the circumstances, I wanted something that was not
tightly coupled to these frameworks because I wanted to use the generator in my
_own_ framework.
I had decided to use
[badcow/lorem-ipsum](https://packagist.org/packages/badcow/lorem-ipsum)
because it did not have any dependencies nor did it rely on any external APIs.
As I started to use the library, I found that I was going to have to fight
with it to get it to do what I wanted. After digging through the code, I
realized that I was going to end up gutting most of it to bend it to my will.
I know when you overhaul someones code the liklihood of them accepting a pull
request goes down dramatically, hence building this library while taking cues
from its predecessor.
[badcow/lorem-ipsum](https://packagist.org/packages/badcow/lorem-ipsum) because
it did not have any dependencies nor did it rely on any external APIs. As I
started to use the library, I found that I was going to have to fight with it to
get it to do what I wanted. After digging through the code, I realized that I
was going to end up gutting most of it to bend it to my will. I know when you
overhaul someones code the likelihood of them accepting a pull request goes
down dramatically, hence building this library while taking cues from its
predecessor.
Also, the aforementioned package had a bunch of “setter” and “getter” methods
that were grossing me out :scream:
## Installation
The preferred installation method is via `composer`. First add the following
to your `composer.json`
The preferred installation method is via `composer`. First add the following to
your `composer.json`
```json
"require": {
@ -54,21 +53,21 @@ $lipsum = new joshtronic\LoremIpsum();
### Generating Words
```php
echo '1 word: ' . $lipsum->word();
echo '1 word: ' . $lipsum->word();
echo '5 words: ' . $lipsum->words(5);
```
### Generating sentences
```php
echo '1 sentence: ' . $lipsum->sentence();
echo '1 sentence: ' . $lipsum->sentence();
echo '5 sentences: ' . $lipsum->sentences(5);
```
### Generating paragraphs
```php
echo '1 paragraph: ' . $lipsum->paragraph();
echo '1 paragraph: ' . $lipsum->paragraph();
echo '5 paragraphs: ' . $lipsum->paragraphs(5);
```
@ -118,15 +117,15 @@ print_r($lipsum->wordsArray(5, 'li'));
## Assumptions
Instead of having an option as to whether or not a string should start the
generated output with “Lorem ipsum dolor sit amet, consectetur adipiscing
elit.” a few assumptions are baked in. The first string generated will always
start with the traditional “Lorem ipsum…”. Subsequent strings may contain
those words but will not explicitly start with them.
generated output with “Lorem ipsum dolor sit amet, consectetur adipiscing elit.”
a few assumptions are baked in. The first string generated will always start
with the traditional “Lorem ipsum…”. Subsequent strings may contain those words
but will not explicitly start with them.
## Contributing
Suggestions and bug reports are always welcome, but karma points are earned
for pull requests.
Suggestions and bug reports are always welcome, but karma points are earned for
pull requests.
Unit tests are required for all contributions. You can run the test suite
from the `tests` directory simply by running `phpunit .`
Unit tests are required for all contributions. You can run the test suite from
the `tests` directory simply by running `phpunit .`