dk_engine/parser/langs/
php.rs1use crate::parser::lang_config::{CommentStyle, LanguageConfig};
4use dk_core::Visibility;
5use tree_sitter::Language;
6
7pub struct PhpConfig;
12
13impl LanguageConfig for PhpConfig {
14 fn language(&self) -> Language {
15 tree_sitter_php::LANGUAGE_PHP.into()
16 }
17
18 fn extensions(&self) -> &'static [&'static str] {
19 &["php"]
20 }
21
22 fn symbols_query(&self) -> &'static str {
23 include_str!("../queries/php_symbols.scm")
24 }
25
26 fn calls_query(&self) -> &'static str {
27 include_str!("../queries/php_calls.scm")
28 }
29
30 fn imports_query(&self) -> &'static str {
31 include_str!("../queries/php_imports.scm")
32 }
33
34 fn comment_style(&self) -> CommentStyle {
35 CommentStyle::SlashSlash
36 }
37
38 fn resolve_visibility(&self, modifiers: Option<&str>, _name: &str) -> Visibility {
39 match modifiers {
40 Some(m) if m.contains("private") => Visibility::Private,
41 Some(m) if m.contains("protected") => Visibility::Public,
42 _ => Visibility::Public,
44 }
45 }
46
47 fn is_external_import(&self, _module_path: &str) -> bool {
48 true
52 }
53}