Make ComposerInspector::getVersion() private

Created on 26 February 2023, over 1 year ago
Updated 27 February 2023, over 1 year ago

Problem/Motivation

In 3.0.x now \Drupal\package_manager\ComposerInspector::getVersion is not used in anywhere except tests.

I think when I added it in 📌 ComposerSettingsValidator should run `composer config` to determine if HTTPS is enabled Fixed is was an example of another Composer process call that used \Drupal\package_manager\JsonProcessOutputCallback but didn't actually need it ourselves

In 📌 Add a validate() method to ComposerInspector to ensure that Composer is usable Fixed getVersion() is being called from within \Drupal\package_manager\ComposerInspector::validate() but then if call it publically it does not call validate() so it is could receive direct composer errors.

See we are not using outside of the class, this is just creating an API we don't use. Do we need to create an API for this since we are responsible for determining if the Composer version is valid.

Proposed resolution

Make \Drupal\package_manager\ComposerInspector::getVersion private and remove the direct test coverage for it.

Remaining tasks

If we are going to make it public we should find a way to validate Composer setup first so the raw Composer errors doesn't bubble up

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇺🇸United States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024