| @@ -1,24 +1,26 @@ | ||
| 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 Cursor Helper. |
| 9 | - * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded | |
| 10 | 7 | */ |
| 11 | 8 | class Import_Cursor_Helper { |
| 12 | 9 | |
| 13 | 10 | /** |
| 11 | + * The Options_Helper. | |
| 12 | + * | |
| 13 | + * @var Options_Helper | |
| 14 | + */ | |
| 15 | + public $options; | |
| 16 | + | |
| 17 | + /** | |
| 14 | 18 | * Class constructor. |
| 15 | 19 | * |
| 16 | 20 | * @param Options_Helper $options The options helper. |
| 17 | 21 | */ |
| 18 | - public function __construct( | |
| 19 | - Options_Helper $options | |
| 20 | - ) { | |
| 22 | + public function __construct( Options_Helper $options ) { | |
| 21 | 23 | $this->options = $options; |
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | /** |
| @@ -23,17 +25,17 @@ | ||
| 23 | 25 | |
| 24 | 26 | /** |
| 25 | 27 | * Returns the stored cursor value. |
| 26 | 28 | * |
| 27 | - * @param string $cursor_id The cursor id. | |
| 28 | - * @param mixed $default The default value if no cursor has been set yet. | |
| 29 | + * @param string $cursor_id The cursor id. | |
| 30 | + * @param mixed $default_value The default value if no cursor has been set yet. | |
| 29 | 31 | * |
| 30 | 32 | * @return int The stored cursor value. |
| 31 | 33 | */ |
| 32 | - public function get_cursor( $cursor_id, $default = 0 ) { | |
| 34 | + public function get_cursor( $cursor_id, $default_value = 0 ) { | |
| 33 | 35 | $import_cursors = $this->options->get( 'import_cursors', [] ); |
| 34 | 36 | |
| 35 | - return ( isset( $import_cursors[ $cursor_id ] ) ) ? $import_cursors[ $cursor_id ] : $default; | |
| 37 | + return ( isset( $import_cursors[ $cursor_id ] ) ) ? $import_cursors[ $cursor_id ] : $default_value; | |
| 36 | 38 | } |
| 37 | 39 | |
| 38 | 40 | /** |
| 39 | 41 | * Stores the current cursor value. |
| @@ -40,9 +42,9 @@ | ||
| 40 | 42 | * |
| 41 | 43 | * @param string $cursor_id The cursor id. |
| 42 | 44 | * @param int $last_imported_id The id of the lastly imported entry. |
| 43 | 45 | * |
| 44 | - * @return void. | |
| 46 | + * @return void | |
| 45 | 47 | */ |
| 46 | 48 | public function set_cursor( $cursor_id, $last_imported_id ) { |
| 47 | 49 | $current_cursors = $this->options->get( 'import_cursors', [] ); |
| 48 | 50 | |