Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add - Added function to get next key in array #1282

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions includes/evf-core-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@
* @return array of form data.
*/
function evf_get_all_forms( $skip_disabled_entries = false, $check_disable_storing_entry_info = true ) {
if( is_null( evf()->form ) ) {

Check failure on line 1135 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Space after opening control structure is required

Check failure on line 1135 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

No space before opening parenthesis is prohibited

Check failure on line 1135 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Expected 1 space(s) after IF keyword; 0 found
return array();
}
$forms = array();
Expand Down Expand Up @@ -1568,11 +1568,11 @@
return false;
}

/** To handle the backward compatibility for those user who is still using the plus and professional plan license key.

Check failure on line 1571 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Doc comment for parameter "$license_plan" missing
*

Check failure on line 1572 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Expected 1 space(s) before asterisk; 0 found
* @since 3.0.0

Check failure on line 1573 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Expected 1 space(s) before asterisk; 0 found
* @param $license_plan License plan.

Check failure on line 1574 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Expected 1 space(s) before asterisk; 0 found

Check failure on line 1574 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Missing parameter name
*/

Check failure on line 1575 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

Expected 1 space(s) before asterisk; 0 found
function evf_handle_license_plan_compatibility( $license_plan ) {
$license_plan = ( 'plus' === $license_plan || 'professional' === $license_plan ) ? 'personal' : $license_plan;
return $license_plan;
Expand Down Expand Up @@ -5575,3 +5575,21 @@
)
);
}

/**
* Retrieve the next key in an array from given key.
*
* @param array $arr List of items in a form of array.
* @param integer $key Key to search and find within the array.
* @return mixed
*/
function evf_get_next_key_array( $arr, $key ) {
$keys = array_keys( $arr );
$position = array_search( $key, $keys, true );

if ( isset( $keys[ $position + 1 ] ) ) {
$next_key = $keys[ $position + 1 ];
}

return isset( $next_key ) ? $next_key : "" ;

Check failure on line 5594 in includes/evf-core-functions.php

View workflow job for this annotation

GitHub Actions / Code sniff (PHP 7.4 , WP Latest)

String "" does not require double quotes; use single quotes instead
}
Loading