Skip to main content

mago_analyzer/plugin/libraries/psl/
mod.rs

1//! PSL (PHP Standard Library) providers.
2
3pub mod async_;
4pub mod dict;
5pub mod regex;
6pub mod str;
7pub mod type_;
8
9use crate::plugin::Plugin;
10use crate::plugin::PluginMeta;
11use crate::plugin::PluginRegistry;
12
13/// Plugin providing type inference for azjezz/psl package.
14pub struct PslPlugin;
15
16static META: PluginMeta = PluginMeta::new(
17    "psl",
18    "PSL (PHP Standard Library)",
19    "Type providers for azjezz/psl package",
20    &["php-standard-library", "azjezz-psl"],
21    false,
22);
23
24impl Plugin for PslPlugin {
25    fn meta(&self) -> &'static PluginMeta {
26        &META
27    }
28
29    fn register(&self, registry: &mut PluginRegistry) {
30        registry.register_function_provider(async_::AllProvider);
31        registry.register_function_provider(async_::ConcurrentlyProvider);
32        registry.register_function_provider(type_::ShapeProvider);
33        registry.register_function_provider(type_::OptionalProvider);
34        registry.register_function_provider(type_::NullishProvider);
35        registry.register_function_provider(type_::IntRangeProvider);
36        registry.register_function_provider(str::StrProvider);
37        registry.register_function_provider(regex::CaptureGroupsProvider);
38        registry.register_function_provider(dict::SelectKeysProvider);
39    }
40}