blob: bb634b9faf88e667eaaa8a76ad1b9fa8837f7bbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
//! ref: composer/src/Composer/Plugin/Capability/Capability.php
use crate::plugin::capability::CommandProvider;
/// Marker interface for Plugin capabilities. Every new Capability which is added to the
/// Plugin API must implement this interface.
///
/// The accessor replaces PHP's `instanceof` downcast on a capability instance of unknown
/// concrete type (the way `PluginInterface::as_capable` does for plugins).
pub trait Capability {
fn as_command_provider(&self) -> Option<&dyn CommandProvider> {
None
}
/// For testing only: recovers the PHP-backed proxy so tests can read capability properties
/// the way PHPUnit asserts `$capability->args`.
fn __as_php_capability_proxy(&self) -> Option<&crate::plugin::PhpCapabilityProxy> {
None
}
}
|