From 7c59300ca2a7b64911456591882c86af525b76f5 Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Sun, 13 Dec 2015 13:46:59 +0100 Subject: [PATCH 1/3] Added support for php7 --- .travis.yml | 1 + README.md | 2 +- composer.json | 2 +- ...{StringSpec.php => StringConverterSpec.php} | 18 +++++++++--------- .../{String.php => StringConverter.php} | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) rename spec/Coduo/ToString/{StringSpec.php => StringConverterSpec.php} (96%) rename src/Coduo/ToString/{String.php => StringConverter.php} (98%) diff --git a/.travis.yml b/.travis.yml index 5941024..952391d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ matrix: - php: 5.4 - php: 5.5 - php: 5.6 + - php: 7.0 - php: hhvm allow_failures: - env: DEPENDENCIES='low' diff --git a/README.md b/README.md index b860b0a..f5cfad9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Add to your composer.json ``` require: { - "coduo/php-to-string": "1.0.*" + "coduo/php-to-string": "2.0.*" } ``` diff --git a/composer.json b/composer.json index cd89c9e..b7ffc8f 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.1-dev" } } } diff --git a/spec/Coduo/ToString/StringSpec.php b/spec/Coduo/ToString/StringConverterSpec.php similarity index 96% rename from spec/Coduo/ToString/StringSpec.php rename to spec/Coduo/ToString/StringConverterSpec.php index fd9b53b..cfbd81e 100644 --- a/spec/Coduo/ToString/StringSpec.php +++ b/spec/Coduo/ToString/StringConverterSpec.php @@ -4,15 +4,7 @@ use PhpSpec\ObjectBehavior; -class Foo -{ - public function __toString() - { - return 'This is Foo'; - } -} - -class StringSpec extends ObjectBehavior +class StringConverterSpec extends ObjectBehavior { /** * @dataProvider positiveConversionExamples @@ -51,3 +43,11 @@ function it_convert_resource_to_string() unlink(sys_get_temp_dir() . "/foo"); } } + +class Foo +{ + public function __toString() + { + return 'This is Foo'; + } +} diff --git a/src/Coduo/ToString/String.php b/src/Coduo/ToString/StringConverter.php similarity index 98% rename from src/Coduo/ToString/String.php rename to src/Coduo/ToString/StringConverter.php index 32e4084..e4292b7 100644 --- a/src/Coduo/ToString/String.php +++ b/src/Coduo/ToString/StringConverter.php @@ -2,7 +2,7 @@ namespace Coduo\ToString; -class String +class StringConverter { /** * @var mixed From 79cbf64ce089ea93477bf95e156172c98ec0b871 Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Sun, 13 Dec 2015 13:48:18 +0100 Subject: [PATCH 2/3] Updated README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f5cfad9..9ccd4f4 100644 --- a/README.md +++ b/README.md @@ -27,19 +27,19 @@ Supported types: * resource ```php -use Coduo\ToString\String; +use Coduo\ToString\StringConverter; -$double = new String(1.12312); +$double = new StringConverter(1.12312); echo $double; // "1.12312" -$datetime = new String(new \DateTime()); +$datetime = new StringConverter(new \DateTime()); echo $datetime; // "\DateTime" -$array = new String(array('foo', 'bar', 'baz')); +$array = new StringConverter(array('foo', 'bar', 'baz')); echo $array; // "Array(3)" $res = fopen(sys_get_temp_dir() . "/foo", "w"); -$resource = new String($res); +$resource = new StringConverter($res); echo $resource; // "Resource(stream)" ``` From 682877fc967858efdfa6c006e7121ef22933b2de Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Sun, 13 Dec 2015 13:58:38 +0100 Subject: [PATCH 3/3] Removed hhvm support --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 952391d..117de40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ matrix: - php: 5.5 - php: 5.6 - php: 7.0 - - php: hhvm allow_failures: - env: DEPENDENCIES='low'