<?php
/**
 * CustomTables Joomla! 3.x/4.x/5.x/6.x Component and WordPress 6.x Plugin
 * @package Custom Tables
 * @subpackage libraries/_checktable.php
 * @author Ivan Komlev <support@joomlaboat.com>
 * @link https://joomlaboat.com
 * @copyright (C) 2018-2026. Ivan Komlev
 * @license GNU/GPL Version 2 or later - https://www.gnu.org/licenses/gpl-2.0.html
 **/

namespace CustomTables;

if (!defined('ABSPATH')) exit;

use CustomTables\Integrity\IntegrityCoreTables;
use CustomTables\Integrity\IntegrityTables;
use Exception;

class IntegrityChecks
{
	/**
	 * @throws Exception
	 * @since 3.2.2
	 */
	public static function check(CT &$ct, $check_core_tables = true, $check_custom_tables = true): array
	{
		$result = []; //Status array

		if ($check_core_tables)
			IntegrityCoreTables::checkCoreTables($ct);

		if ($check_custom_tables)
			$result = IntegrityTables::checkTables($ct);

		return $result;
	}
}
