<?php

/**
 * Shared PHP string helpers for static safety rules.
 *
 * @package LolaCore\PluginBuilder\Generation\Safety
 * @license GPL-2.0-or-later
 */

declare(strict_types=1);

namespace LolaCore\PluginBuilder\Generation\Safety;

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

/**
 * Compatibility delegator: the implementation lives in
 * LolaCore\Builder\Safety\SafetyPhpHelper (FS-S1 backbone extraction).
 */
final class SafetyPhpHelper {

	/**
	 * Remove block and line comments so pattern checks ignore docblocks.
	 */
	public static function stripComments( string $php ): string {
		return \LolaCore\Builder\Safety\SafetyPhpHelper::stripComments($php);
	}

	public static function lineNumberForMatch( string $php, string $needle ): int {
		return \LolaCore\Builder\Safety\SafetyPhpHelper::lineNumberForMatch($php, $needle);
	}
}
