From 080dc10c8f5420fef35163569293601f17124eeb Mon Sep 17 00:00:00 2001 From: alrik11es Date: Thu, 25 Aug 2016 09:53:44 +0200 Subject: [PATCH] Improved docs, removed support for older php versions. --- .travis.yml | 4 --- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++--- bin/cowsayphp | 5 ++++ composer.json | 2 +- src/Cow.php | 2 +- 5 files changed, 73 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index cbbca6b..cfec6ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,7 @@ language: php php: - - 5.3 - - 5.4 - - 5.5 - 5.6 - - 6 - 7 - hhvm diff --git a/README.md b/README.md index dae4caa..607e406 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Do you remember classic linux Cowsay? Well this is a port for PHP if you want lovely cows everywhere in your terminal apps. +Now supporting more animals in the farm. + ## Install Via Composer @@ -17,13 +19,15 @@ Via Composer ``` bash $ composer require alrik11es/cowsayphp ``` +Requires PHP >=5.6 -## Usage +## Using ``` php -use Cowsayphp\Cow; +use Cowsayphp\Farm; -echo '
'.Cow::say("Ohmg I'm a cow!").'
'; +$cow = Farm::create(\Cowsayphp\Farm\Cow::class); +echo '
'.$cow->say("Ohmg I'm a cow!").'
'; ``` The result: @@ -35,10 +39,68 @@ The result: ||----w | || || +### Other animals + +_\Cowsayphp\Farm\Whale::class_ + + < hello I'm a whale! > + \ + \ ## . + ## ## ## == + ## ## ## ## ## === + /"""""""""""""""""\___/ === + ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ + \______ o __/ + \ \ __/ + \____\_______/ + +_\Cowsayphp\Farm\Dragon::class_ + + < Dragon! > + \ / \ //\ + \ |\___/| / \// \\ + /0 0 \__ / // | \ \ + / / \/_/ // | \ \ + @_^_@'/ \/_ // | \ \ + //_^_/ \/_ // | \ \ + ( //) | \/// | \ \ + ( / /) _|_ / ) // | \ _\ + ( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-. + (( / / )) ,-{ _ `-.|.-~-. .~ `. + (( // / )) '/\ / ~-. _ .-~ .-~^-. \ + (( /// )) `. { } / \ \ + (( / )) .----~-.\ \-' .~ \ `. \^-. + ///.----..> \ _ -~ `. ^-` ^-_ + ///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~ + +_\Cowsayphp\Farm\Tux::class_ + + < Tux present! > + \ + \ + .--. + |o_o | + |:_/ | + // \ \ + (| | ) + /'\_ _/`\ + \___)=(___/ + + +## Deprecated use + +This will be deprecated in future versions. But still works. + +``` php +use Cowsayphp\Cow; + +echo '
'.Cow::say("Ohmg I'm a cow!").'
'; +``` + ## Testing ``` bash -$ phpunit +$ ./bin/phpunit ``` ## Contributing diff --git a/bin/cowsayphp b/bin/cowsayphp index f408e48..2257329 100755 --- a/bin/cowsayphp +++ b/bin/cowsayphp @@ -1,5 +1,9 @@ #!/usr/bin/env php 1){ + // Todo: Create a way to select the animal from the terminal $cow = \Cowsayphp\Farm::create(\Cowsayphp\Farm\Cow::class); echo $cow->say($argv[1]); } diff --git a/composer.json b/composer.json index 25c2d5f..c453157 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php" : ">=5.3.0" + "php" : ">=5.6.0" }, "require-dev": { "phpunit/phpunit" : "5.*", diff --git a/src/Cow.php b/src/Cow.php index f5c2a0b..0568e2f 100644 --- a/src/Cow.php +++ b/src/Cow.php @@ -9,7 +9,7 @@ class Cow { public static function say($text) { - $cow = Farm::create('\Cowsayphp\Farm\Cow'); // @todo: Deprecate support for php <=5.5 \Cowsayphp\Farm\Cow::class + $cow = Farm::create(\Cowsayphp\Farm\Cow::class); return $cow->say($text); } } \ No newline at end of file