From 77473c5b31306c7205bb2b2c3dd91476463bb958 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 4 Oct 2014 11:04:21 -0400 Subject: [PATCH 1/4] Dropped sort class from the core --- src/Sort.php | 70 -------------------------------------- tests/Pickles/SortTest.php | 61 --------------------------------- 2 files changed, 131 deletions(-) delete mode 100644 src/Sort.php delete mode 100644 tests/Pickles/SortTest.php diff --git a/src/Sort.php b/src/Sort.php deleted file mode 100644 index 5c2a4d9..0000000 --- a/src/Sort.php +++ /dev/null @@ -1,70 +0,0 @@ -' : '<') .' $b) ? -1 : 1; - ')); - - return true; - } -} - diff --git a/tests/Pickles/SortTest.php b/tests/Pickles/SortTest.php deleted file mode 100644 index ed916f2..0000000 --- a/tests/Pickles/SortTest.php +++ /dev/null @@ -1,61 +0,0 @@ - 'epsilon'], - ['name' => 'gamma'], - ['name' => 'alpha'], - ['name' => 'delta'], - ['name' => 'beta'], - ]; - - $sorted = [ - ['name' => 'alpha'], - ['name' => 'beta'], - ['name' => 'delta'], - ['name' => 'epsilon'], - ['name' => 'gamma'], - ]; - - Pickles\Sort::by('name', $shuffled); - - $this->assertEquals($sorted, $shuffled); - } - - public function testByNameDESC() - { - $shuffled = [ - ['name' => 'epsilon'], - ['name' => 'gamma'], - ['name' => 'alpha'], - ['name' => 'delta'], - ['name' => 'beta'], - ]; - - $sorted = [ - ['name' => 'gamma'], - ['name' => 'epsilon'], - ['name' => 'delta'], - ['name' => 'beta'], - ['name' => 'alpha'], - ]; - - Pickles\Sort::by('name', $shuffled, Pickles\Sort::DESC); - - $this->assertEquals($sorted, $shuffled); - } - - public function testMissingField() - { - $shuffled = [['foo' => 'bar', 'bar' => 'foo']]; - $sorted = [['foo' => 'bar', 'bar' => 'foo']]; - - Pickles\Sort::by('name', $shuffled); - - $this->assertEquals($sorted, $shuffled); - } -} - From ee34d8aff9e935915519c6c7350e619bb6d40fd8 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 4 Oct 2014 11:08:01 -0400 Subject: [PATCH 2/4] Standardized the badges --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8d9c0fc..5354487 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Pickles -[![Build Status](https://travis-ci.org/picklesphp/pickles.png?branch=master)](https://travis-ci.org/picklesphp/pickles) -[![Coverage Status](https://coveralls.io/repos/picklesphp/pickles/badge.png)](https://coveralls.io/r/picklesphp/pickles) -[![Dependency Status](https://www.versioneye.com/user/projects/52d1bc1eec13751bde00002a/badge.png)](https://www.versioneye.com/user/projects/52d1bc1eec13751bde00002a) -[![Stories in Ready](https://badge.waffle.io/picklesphp/pickles.png?label=ready&title=Ready)](https://waffle.io/picklesphp/pickles) +[![License](http://img.shields.io/packagist/l/picklesphp/pickles.svg?style=flat)][packagist] +[![Build](http://img.shields.io/travis/picklesphp/pickles.svg?style=flat)][travis] +[![Coverage](http://img.shields.io/coveralls/picklesphp/pickles.svg?style=flat)][coveralls] +[![Downloads](http://img.shields.io/packagist/dt/picklesphp/pickles.svg?style=flat)][packagist] Pickles f/k/a PICKLES (PHP Interface Collection of Killer Libraries to Enhance Stuff) is an open source framework for the rapid development of RESTful @@ -20,11 +20,9 @@ contributor, [Justin Davis][JustinDavis] for romanticizing the v2 reimagining and [Dean Jones][DeanJones] for helping to come up with the original PICKLES v1 acronym. +[coveralls]: https://coveralls.io/r/picklesphp/pickles +[packagist]: https://packagist.org/packages/picklesphp/pickles +[travis]: http://travis-ci.org/picklesphp/pickles [DeanJones]: https://github.com/deanproxy [GeoffOliver]: https://github.com/geoffoliver [JustinDavis]: http://justindavis.co - -[HolidayAPI]: https://github.com/gravityblvd/tools.gravityblvd.com -[MasterZip]: https://github.com/picklesphp/pickles/archive/master.zip -[StackPost]: http://joshtronic.com/2014/01/13/your-stack-is-outdated/#.UuVzI3n0A18 -[v13.12]: https://github.com/picklesphp/pickles/tree/13.12 From 6c148c124ee7343f5df50453551ab660a7d2dac2 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 4 Oct 2014 11:10:59 -0400 Subject: [PATCH 3/4] Added self-update to the travis build Making this a standard thing in my travis scripts because it seems they let the version go stale pretty regularly. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 281f474..61a281d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ services: - redis install: + - composer self-update - composer install before_script: From c5d39db63bc6f12d0bcbdebe1d4dacf13d5d6edd Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Mon, 6 Oct 2014 18:27:53 -0400 Subject: [PATCH 4/4] Brought Sort back into the repo Decided that having a bunch of external dependencies would end up being more trouble than it's worth --- src/Sort.php | 70 ++++++++++++++++++++++++++++++++++++++ tests/Pickles/SortTest.php | 61 +++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 src/Sort.php create mode 100644 tests/Pickles/SortTest.php diff --git a/src/Sort.php b/src/Sort.php new file mode 100644 index 0000000..5c2a4d9 --- /dev/null +++ b/src/Sort.php @@ -0,0 +1,70 @@ +' : '<') .' $b) ? -1 : 1; + ')); + + return true; + } +} + diff --git a/tests/Pickles/SortTest.php b/tests/Pickles/SortTest.php new file mode 100644 index 0000000..ed916f2 --- /dev/null +++ b/tests/Pickles/SortTest.php @@ -0,0 +1,61 @@ + 'epsilon'], + ['name' => 'gamma'], + ['name' => 'alpha'], + ['name' => 'delta'], + ['name' => 'beta'], + ]; + + $sorted = [ + ['name' => 'alpha'], + ['name' => 'beta'], + ['name' => 'delta'], + ['name' => 'epsilon'], + ['name' => 'gamma'], + ]; + + Pickles\Sort::by('name', $shuffled); + + $this->assertEquals($sorted, $shuffled); + } + + public function testByNameDESC() + { + $shuffled = [ + ['name' => 'epsilon'], + ['name' => 'gamma'], + ['name' => 'alpha'], + ['name' => 'delta'], + ['name' => 'beta'], + ]; + + $sorted = [ + ['name' => 'gamma'], + ['name' => 'epsilon'], + ['name' => 'delta'], + ['name' => 'beta'], + ['name' => 'alpha'], + ]; + + Pickles\Sort::by('name', $shuffled, Pickles\Sort::DESC); + + $this->assertEquals($sorted, $shuffled); + } + + public function testMissingField() + { + $shuffled = [['foo' => 'bar', 'bar' => 'foo']]; + $sorted = [['foo' => 'bar', 'bar' => 'foo']]; + + Pickles\Sort::by('name', $shuffled); + + $this->assertEquals($sorted, $shuffled); + } +} +