From 02b97224f2e5fa0f9e4c6d437f0f5294598470e4 Mon Sep 17 00:00:00 2001 From: Gabriel Schmitt Date: Fri, 10 Oct 2014 14:55:19 -0300 Subject: [PATCH 1/7] Fixing unused variable on byte generation loop. --- src/Uuid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uuid.php b/src/Uuid.php index fffe874..7f1c91a 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -1225,7 +1225,7 @@ final class Uuid } $bytes = ''; - foreach (range(1, $length) as $i) { + for ($i = 1; $i <= $length; $i++) { $bytes = chr(mt_rand(0, 255)) . $bytes; } From 3ba3365808246bf3b816612b7b56c4366fde43f5 Mon Sep 17 00:00:00 2001 From: Johnson Date: Sun, 19 Oct 2014 15:52:33 +1100 Subject: [PATCH 2/7] Use toString function in README This helps illustrate that the uuidX() functions return Uuid objects, and not strings. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 794da6d..5df41db 100644 --- a/README.md +++ b/README.md @@ -59,21 +59,21 @@ use Rhumsaa\Uuid\Exception\UnsatisfiedDependencyException; try { - // Generate a version 1 (time-based) UUID + // Generate a version 1 (time-based) UUID object $uuid1 = Uuid::uuid1(); - echo $uuid1 . "\n"; // e4eaaaf2-d142-11e1-b3e4-080027620cdd + echo $uuid1->toString() . "\n"; // e4eaaaf2-d142-11e1-b3e4-080027620cdd - // Generate a version 3 (name-based and hashed with MD5) UUID + // Generate a version 3 (name-based and hashed with MD5) UUID object $uuid3 = Uuid::uuid3(Uuid::NAMESPACE_DNS, 'php.net'); - echo $uuid3 . "\n"; // 11a38b9a-b3da-360f-9353-a5a725514269 + echo $uuid3->toString() . "\n"; // 11a38b9a-b3da-360f-9353-a5a725514269 - // Generate a version 4 (random) UUID + // Generate a version 4 (random) UUID object $uuid4 = Uuid::uuid4(); - echo $uuid4 . "\n"; // 25769c6c-d34d-4bfe-ba98-e0ee856f3e7a + echo $uuid4->toString() . "\n"; // 25769c6c-d34d-4bfe-ba98-e0ee856f3e7a - // Generate a version 5 (name-based and hashed with SHA1) UUID + // Generate a version 5 (name-based and hashed with SHA1) UUID object $uuid5 = Uuid::uuid5(Uuid::NAMESPACE_DNS, 'php.net'); - echo $uuid5 . "\n"; // c4a760a8-dbcf-5254-a0d9-6a4474bd1b62 + echo $uuid5->toString() . "\n"; // c4a760a8-dbcf-5254-a0d9-6a4474bd1b62 } catch (UnsatisfiedDependencyException $e) { From 6ae242b0ccab80f94bc52ef48febfd52ae282941 Mon Sep 17 00:00:00 2001 From: Johnson Date: Sun, 19 Oct 2014 17:43:04 +1100 Subject: [PATCH 3/7] Set the default timezone to avoid errors in hhvm Added a default timezone to the bootstrap.php to fix errors in HHVM tests, which was introduced when Travis removed the default `/etc/hhvm/php.ini` in https://github.com/travis-ci/travis-ci/issues/2523#issuecomment-59303763 --- tests/bootstrap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2f16bac..786bef2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,7 @@ Date: Fri, 24 Oct 2014 09:55:25 +0100 Subject: [PATCH 4/7] Exclude build/development tools from releases using .gitattributes --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bc2c43f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +/.gitignore export-ignore +/.gitattributes export-ignore +/.travis.yml export-ignore +/tests export-ignore +/phpunit.xml.dist export-ignore +/apigen.neon export-ignore From e66eb997a1894b40bbab1a972fec0ffc00a2ac87 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 24 Oct 2014 08:55:20 -0500 Subject: [PATCH 5/7] Set timezone for tests --- tests/bootstrap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2f16bac..786bef2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,7 @@ Date: Wed, 29 Oct 2014 22:36:49 -0500 Subject: [PATCH 6/7] Bumping the version number to 2.7.4 --- CHANGELOG.md | 5 +++++ src/Uuid.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bc14ee..2698915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +* 2.7.4 (2014-10-29) + * Changed loop in `generateBytes()` from `foreach` to `for`; see #33 + * Use `toString()` in README examples to avoid confusion + * Exclude build/development tools from releases using .gitattributes + * Set timezone properly for tests * 2.7.3 (2014-08-27) * Fixed upper range for `mt_rand` used in version 4 UUIDs * 2.7.2 (2014-07-28) diff --git a/src/Uuid.php b/src/Uuid.php index 7f1c91a..f6357a8 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -93,7 +93,7 @@ final class Uuid /** * Version of the Rhumsaa\Uuid package */ - const VERSION = '2.7.x-dev'; + const VERSION = '2.7.4'; /** * For testing, 64-bit system override; if true, treat the system as 32-bit From 94b0103ef8ba1fc656306d476bb5b4df6dae23eb Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 29 Oct 2014 22:39:33 -0500 Subject: [PATCH 7/7] Setting version in master to 2.7.x-dev --- src/Uuid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uuid.php b/src/Uuid.php index f6357a8..7f1c91a 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -93,7 +93,7 @@ final class Uuid /** * Version of the Rhumsaa\Uuid package */ - const VERSION = '2.7.4'; + const VERSION = '2.7.x-dev'; /** * For testing, 64-bit system override; if true, treat the system as 32-bit