diff --git a/classes/local/step/directory_file_list_trait.php b/classes/local/step/directory_file_list_trait.php index a90fb04e..ea094c4a 100644 --- a/classes/local/step/directory_file_list_trait.php +++ b/classes/local/step/directory_file_list_trait.php @@ -16,7 +16,6 @@ namespace tool_dataflows\local\step; -use MoodleQuickForm; use tool_dataflows\helper; /** @@ -171,19 +170,21 @@ public function validate_for_run() { /** * Apply various constraints/transforms to the list of files * - * @param array $filelist - * @param mixed $returnvalue - * @param mixed $offset - * @param mixed $limit + * @param array $filelist + * @param string $returnvalue + * @param string $sort + * @param int $offset + * @param int $limit * @param bool $includedir - * @param string $path + * @param string $basepath + * @param string $pattern * @return array Will return true or an array of errors. */ public function apply_list_constraints( array $filelist, - $returnvalue, + string $returnvalue, string $sort, - $offset, + int $offset, ?int $limit, bool $includedir, string $basepath, diff --git a/classes/local/step/sftp_directory_file_list_trait.php b/classes/local/step/sftp_directory_file_list_trait.php index 7edf1f88..54677d6a 100644 --- a/classes/local/step/sftp_directory_file_list_trait.php +++ b/classes/local/step/sftp_directory_file_list_trait.php @@ -46,7 +46,7 @@ trait sftp_directory_file_list_trait { public static function form_define_fields(): array { $fields = array_merge( self::sftp_form_define_fields('list'), - self::directory_file_list_form_define_fields(), + self::directory_file_list_form_define_fields() ); return $fields; @@ -89,7 +89,7 @@ public function run() { $config->limit, isset($config->subdirectories), $path, - $config->pattern, + $config->pattern ); return $filelist; diff --git a/classes/local/step/sftp_trait.php b/classes/local/step/sftp_trait.php index eaad541d..fce14b9a 100644 --- a/classes/local/step/sftp_trait.php +++ b/classes/local/step/sftp_trait.php @@ -130,6 +130,7 @@ public function form_add_custom_inputs(\MoodleQuickForm &$mform, $behaviour = 'c * Validate the configuration settings. * * @param object $config + * @param string $behaviour * @return true|\lang_string[] true if valid, an array of errors otherwise */ public function validate_config($config, $behaviour = 'copy') { @@ -203,6 +204,7 @@ public function validate_config($config, $behaviour = 'copy') { /** * Perform any extra validation that is required only for runs. * + * @param string $behaviour * @return true|array Will return true or an array of errors. */ public function validate_for_run($behaviour = 'copy') { diff --git a/tests/tool_dataflows_sftp_test.php b/tests/tool_dataflows_sftp_test.php index 12afef4a..04786f3a 100644 --- a/tests/tool_dataflows_sftp_test.php +++ b/tests/tool_dataflows_sftp_test.php @@ -30,7 +30,8 @@ */ class tool_dataflows_sftp_test extends \advanced_testcase { - private array $filelist = [ + /** @var array list of realistic file paths to test. */ + private $filelist = [ 'test.txt', 'test.pdf', 'test.csv',