conditions[ $condition->get_type() ] = $condition; } /** * Get all registered conditions. * * @return Condition[] */ public function get_all() { return $this->conditions; } /** * Get a condition by type. * * @param string $type Condition type. * @return Condition|null */ public function get( $type ) { return isset( $this->conditions[ $type ] ) ? $this->conditions[ $type ] : null; } }