NAME

Koha::QA::Base - Base class for Koha QA modules

SYNOPSIS

use base 'Koha::QA::Base';

sub new {
    my ($class, $params) = @_;
    my $self = $class->SUPER::new($params);
    # ... child class initialization
    return $self;
}

DESCRIPTION

This is the base class for Koha QA modules. It provides common functionality for file/content handling and error management.

METHODS

new

my $checker = $class->SUPER::new({file => $file_path});
my $checker = $class->SUPER::new({content => $template_content});

Creates a new QA checker instance. Accepts either a 'file' parameter (path to a file to read) or a 'content' parameter (string content).

content

my $content = $checker->content;

Returns the content being checked.

file

my $file_path = $checker->file;

Returns the file path being checked. If the object was created with content instead of a file, this method will generate a temporary file with the content.

errors

my @errors = $checker->errors;

Returns array of error hashrefs.

AUTHORS

Jonathan Druart <jonathan.druart@bugs.koha-community.org>

COPYRIGHT

Copyright 2026 Koha Development Team

LICENSE

This file is part of Koha.

Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.