required_models as $model_name) { // Check if class exists in manifest try { $metadata = Manifest::php_get_metadata_by_class($model_name); if (empty($metadata)) { $this->add_violation( 'rsx/models/', 0, "Required model class '{$model_name}' not found in manifest", '', 'Create the model file at rsx/models/' . strtolower(str_replace('_', '_', $model_name)) . '.php', 'critical' ); continue; } // Check if it extends Rsx_Model_Abstract if (!Manifest::php_is_subclass_of($model_name, 'Rsx_Model_Abstract')) { $file_path = $metadata['file'] ?? 'unknown'; $this->add_violation( $file_path, 0, "Required model '{$model_name}' does not extend Rsx_Model_Abstract", '', "Make sure {$model_name} extends Rsx_Model_Abstract or a subclass of it", 'critical' ); } } catch (Exception $e) { $this->add_violation( 'rsx/models/', 0, "Required model class '{$model_name}' not found in manifest", '', 'Create the model file at rsx/models/' . strtolower(str_replace('_', '_', $model_name)) . '.php', 'critical' ); } } } }