$line) { $line_number = $line_num + 1; // Check for @extends('rsx:: pattern (with single or double quotes) if (preg_match('/@extends\s*\(\s*[\'"]rsx::([^\'"]+)[\'"]/', $line, $matches)) { $layout_reference = $matches[1] ?? ''; // Build suggestion $suggestion = "The @extends directive with 'rsx::' namespace is incorrect.\n"; $suggestion .= "Use the @rsx_extends directive instead:\n"; $suggestion .= " Replace: @extends('rsx::{$layout_reference}')\n"; $suggestion .= " With: @rsx_extends('{$layout_reference}')\n\n"; $suggestion .= "The @rsx_extends directive uses the RSX ID system to locate layouts "; $suggestion .= "by their RSX ID rather than file paths."; $this->add_violation( $file_path, $line_number, "Incorrect use of @extends('rsx::...'). Use @rsx_extends instead.", trim($line), $suggestion, 'high' ); } } } }