From 767bd4d8faf2ee16b5a432d682acdf460bb3b690 Mon Sep 17 00:00:00 2001 From: Diganta Mondal <39664682+digantaTheProgrammer@users.noreply.github.com> Date: Sun, 7 Jul 2019 13:55:08 +0530 Subject: [PATCH 1/3] Fixed keys( ) , all( ) function ("magical" call ) Previously "magical" call version of the functions 'keys' , 'all' would break as the call : keys( "key1" , "key2" , "key3" , false ); would result in $mask = ( "key1" , "key2" , "key3" , false ) whereas $fill_with_nulls = "key2" (ultimately translating to true) thus breaking the intended function call which is $mask = ( "key1" , "key2" , "key3" ) and $fill_with_nulls = false Same is applicable for the function 'all' --- src/Klein/DataCollection/DataCollection.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Klein/DataCollection/DataCollection.php b/src/Klein/DataCollection/DataCollection.php index aac0125e..bb08c7ff 100644 --- a/src/Klein/DataCollection/DataCollection.php +++ b/src/Klein/DataCollection/DataCollection.php @@ -71,6 +71,12 @@ public function keys($mask = null, $fill_with_nulls = true) // Support a more "magical" call if (!is_array($mask)) { $mask = func_get_args(); + $arglen=count($mask); + if($mask[$arglen-1]===false || $mask[$arglen-1]===true) + { + $fill_with_nulls=$mask[$arglen-1]; + array_pop($mask); + } } /* @@ -113,6 +119,12 @@ public function all($mask = null, $fill_with_nulls = true) // Support a more "magical" call if (!is_array($mask)) { $mask = func_get_args(); + $arglen=count($mask); + if($mask[$arglen-1]===false || $mask[$arglen-1]===true) + { + $fill_with_nulls=$mask[$arglen-1]; + array_pop($mask); + } } /* From 8983206d3a989a19a17a4ec3fbed90e97b43ae97 Mon Sep 17 00:00:00 2001 From: Diganta Mondal <39664682+digantaTheProgrammer@users.noreply.github.com> Date: Sun, 7 Jul 2019 14:42:06 +0530 Subject: [PATCH 2/3] Fixed tarvis.yml --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d8ad4419..55e07489 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ sudo: false language: php php: - - 5.3 - 5.4 - 5.5 - 5.6 @@ -11,6 +10,9 @@ php: - hhvm matrix: + include: + - php: 5.3 + dist: precise allow_failures: - php: nightly - php: hhvm From d7cc2122abe32b751f50ae12bdc8e1d9ff0098c6 Mon Sep 17 00:00:00 2001 From: Diganta Mondal <39664682+digantaTheProgrammer@users.noreply.github.com> Date: Sun, 7 Jul 2019 14:46:34 +0530 Subject: [PATCH 3/3] Fixing travis.yml Dropping PHP 5.3 as suggested by others --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55e07489..362177a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,6 @@ php: - hhvm matrix: - include: - - php: 5.3 - dist: precise allow_failures: - php: nightly - php: hhvm