mago-analyzer 1.25.0

A PHP static analyzer that can detect type errors in PHP code, and provide suggestions for fixing them.
Documentation
//! PSL (PHP Standard Library) providers.

pub mod async_;
pub mod dict;
pub mod regex;
pub mod str;
pub mod type_;

use crate::plugin::Plugin;
use crate::plugin::PluginMeta;
use crate::plugin::PluginRegistry;

/// Plugin providing type inference for azjezz/psl package.
pub struct PslPlugin;

static META: PluginMeta = PluginMeta::new(
    "psl",
    "PSL (PHP Standard Library)",
    "Type providers for azjezz/psl package",
    &["php-standard-library", "azjezz-psl"],
    false,
);

impl Plugin for PslPlugin {
    fn meta(&self) -> &'static PluginMeta {
        &META
    }

    fn register(&self, registry: &mut PluginRegistry) {
        registry.register_function_provider(async_::AllProvider);
        registry.register_function_provider(async_::ConcurrentlyProvider);
        registry.register_function_provider(type_::ShapeProvider);
        registry.register_function_provider(type_::OptionalProvider);
        registry.register_function_provider(type_::NullishProvider);
        registry.register_function_provider(type_::IntRangeProvider);
        registry.register_function_provider(str::StrProvider);
        registry.register_function_provider(regex::CaptureGroupsProvider);
        registry.register_function_provider(dict::SelectKeysProvider);
    }
}