//! ref: composer/src/Composer/Plugin/PluginInterface.php use crate::composer::Composer; use crate::io::io_interface::IOInterface; use crate::plugin::capable::Capable; pub const PLUGIN_API_VERSION: &'static str = "2.9.0"; pub trait PluginInterface: std::fmt::Debug { fn activate(&mut self, composer: &Composer, io: &dyn IOInterface); fn deactivate(&mut self, composer: &Composer, io: &dyn IOInterface); fn uninstall(&mut self, composer: &Composer, io: &dyn IOInterface); fn clone_box(&self) -> Box { todo!() } // TODO(plugin): PHP-side `instanceof` checks for EventSubscriberInterface / Capable. // EventSubscriberInterface is not dyn-compatible (its only method is associated, not // a `&self` method), so we expose a boolean predicate instead. fn is_event_subscriber_interface(&self) -> bool { false } fn as_capable(&self) -> Option<&dyn Capable> { None } }