| @@ -1,10 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Yoast\WP\SEO\Helpers; |
| 4 | 4 | |
| 5 | -use Yoast\WP\SEO\Helpers\Options_Helper; | |
| 6 | - | |
| 7 | 5 | /** |
| 8 | 6 | * The Import Helper. |
| 9 | 7 | */ |
| 10 | 8 | class Import_Helper { |
| @@ -11,18 +9,18 @@ | ||
| 11 | 9 | |
| 12 | 10 | /** |
| 13 | 11 | * Flattens a multidimensional array of settings. Recursive. |
| 14 | 12 | * |
| 15 | - * @param array $array The array to be flattened. | |
| 16 | - * @param string $key_prefix The key to be used as a prefix. | |
| 13 | + * @param array $array_to_flatten The array to be flattened. | |
| 14 | + * @param string $key_prefix The key to be used as a prefix. | |
| 17 | 15 | * |
| 18 | 16 | * @return array The flattened array. |
| 19 | 17 | */ |
| 20 | - public function flatten_settings( $array, $key_prefix = '' ) { | |
| 18 | + public function flatten_settings( $array_to_flatten, $key_prefix = '' ) { | |
| 21 | 19 | $result = []; |
| 22 | - foreach ( $array as $key => $value ) { | |
| 23 | - if ( is_array( $value ) ) { | |
| 24 | - $result = array_merge( $result, $this->flatten_settings( $value, $key_prefix . '/' . $key ) ); | |
| 20 | + foreach ( $array_to_flatten as $key => $value ) { | |
| 21 | + if ( \is_array( $value ) ) { | |
| 22 | + $result = \array_merge( $result, $this->flatten_settings( $value, $key_prefix . '/' . $key ) ); | |
| 25 | 23 | } |
| 26 | 24 | else { |
| 27 | 25 | $result[ $key_prefix . '/' . $key ] = $value; |
| 28 | 26 | } |