From 6749413d2972e3fecd2200b71fb58419f7196811 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 10 Mar 2019 18:08:18 +0100 Subject: [PATCH] PHP 5.6 compatibility changes --- composer.lock | 9 +++++++-- ipf/auth/admin.php | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index ba57864..348c147 100644 --- a/composer.lock +++ b/composer.lock @@ -102,7 +102,7 @@ "source": { "type": "git", "url": "git://git.andy128k.net/missing-tools.git", - "reference": "a8674960793b9c9fb3a90b83558f972a28f7ed75" + "reference": "5e4d636d7de3ee2cd6037e82f733950dda88a8b5" }, "require": { "andy128k/pegp": "0.1.*@dev", @@ -117,6 +117,11 @@ "src/" ] }, + "scripts": { + "test": [ + "phpunit ./t" + ] + }, "license": [ "MIT" ], @@ -127,7 +132,7 @@ } ], "description": "Miscellaneous utilities", - "time": "2016-11-05T14:33:30+00:00" + "time": "2019-03-10T17:05:21+00:00" }, { "name": "andy128k/pegp", diff --git a/ipf/auth/admin.php b/ipf/auth/admin.php index f60fd0b..5d222d2 100644 --- a/ipf/auth/admin.php +++ b/ipf/auth/admin.php @@ -78,7 +78,7 @@ class UserForm extends \IPF_ObjectForm $this->fields['roles'] = new \IPF_Admin_Form_Field_MultipleChoice(array( 'label' => __('Groups'), 'help_text' => __('In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in.'), - 'choices' => array_column(Role::all(), 'id', 'name'), + 'choices' => \PFF\Collection::columnByProperty(Role::all(), 'id', 'name'), )); } @@ -169,7 +169,7 @@ class AdminUser extends Component ' LIMIT ' . $pageSize . ' OFFSET ' . (($page - 1) * $pageSize) ); - return array_column($items, null, 'id'); + return \PFF\Collection::indexByProperty($items, 'id'); } public function itemsCount($searchValue, $filters) @@ -310,7 +310,7 @@ class AdminRole extends Component ' LIMIT ' . $pageSize . ' OFFSET ' . (($page - 1) * $pageSize) ); - return array_column($items, null, 'id'); + return \PFF\Collection::indexByProperty($items, 'id'); } public function itemsCount($searchValue, $filters) -- 2.49.0