Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Conversation

ashatrov
Copy link
Contributor

@ashatrov ashatrov commented May 4, 2017

@ashatrov ashatrov force-pushed the 373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager branch from 312c054 to cf1c8ec Compare May 4, 2017 10:57
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling 312c054 on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling 312c054 on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling cf1c8ec on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling cf1c8ec on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

@prolic
Copy link
Collaborator

prolic commented May 4, 2017

Please add a test case that fails without this addition.

@ashatrov
Copy link
Contributor Author

ashatrov commented May 4, 2017

@prolic I have no idea how to simulate it.

Anyway, it is the correct way to get firsts key of Array, because the internal pointer can point beyond the end of the elements list.

http://php.net/manual/en/function.key.php

Return Values

The key() function simply returns the key of the array element that's currently being pointed to by the internal pointer. It does not move the pointer in any way. If the internal pointer points beyond the end of the elements list or the array is empty, key() returns NULL.

If we need to have the first key, it must be with reset(), because we cannot know where is pointer now.

@ashatrov
Copy link
Contributor Author

ashatrov commented May 4, 2017

e.g.

<?php
$arr = ['foo' => 1];

echo key($arr); // foo

next($arr);
echo key($arr); // Null

reset($arr);
echo key($arr); // foo

Maybe there is while(next($config)) { // do something } somewhere in ZF.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling 9204991 on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling 9204991 on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

@ashatrov ashatrov force-pushed the 373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager branch from 9204991 to 6dea80b Compare May 4, 2017 14:10
Copy link
Collaborator

@prolic prolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, what do you think @basz?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling 6dea80b on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.954% when pulling 6dea80b on ashatrov:373_Cannot_get_a_name_and_parameters_for_RoleProviderPluginManager into 2ce24f1 on ZF-Commons:master.

@humayunjamal
Copy link

Hi Guys waiting for this pr to be merged

@prolic prolic merged commit dd1857a into ZF-Commons:master May 7, 2017
@ghost
Copy link

ghost commented May 7, 2017

@prolic What is the policy for releases? Will you create a minor release 2.6.3 with this changes to be able to use it in composer from packagist?

@prolic
Copy link
Collaborator

prolic commented May 9, 2017

@ashatrov-propertyfinder done with https://github.com/ZF-Commons/zfc-rbac/releases/tag/v2.6.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants