add_violation( $file_path, 0, 'Layout file must be within ./rsx/app/ directory', null, 'Move this layout to ./rsx/app/(module)/ or a subdirectory within a module', 'convention' ); return; } // Count directory levels after rsx/app/ $after_app = substr($relative_path, strlen('rsx/app/')); $parts = explode('/', $after_app); // Layout must be at least 2 levels deep: module/file.php if (count($parts) < 2) { $this->add_violation( $file_path, 0, 'Layout file must be within a module directory, not directly in ./rsx/app/', null, 'Move this layout to ./rsx/app/(module)/ or a subdirectory within a module', 'convention' ); } } }