acquia / drupal-environment-detector

Provides common methods for detecting the current Acquia environment
GNU General Public License v2.0
10 stars 13 forks source link

BLT-5203: AcquiaDrupalEnvironmentDetector::getAhEnv() method has incorrect return description #60

Closed Matroskeen closed 1 year ago

Matroskeen commented 1 year ago

In AcquiaDrupalEnvironmentDetector::getAhEnv() method the possible return values are described as dev, stage, prod. According to Acquia documentation the actual values are dev, test, prod, ide.

When I checked the method, it made me doubt and double-check the test vs stage environment name because I wasn't sure which one is right.

Code:

/**
   * Get Acquia hosting environment.
   *
   * @return string
   *   Environment name (e.g. dev, stage, prod).
   */
  public static function getAhEnv() {
    return getenv('AH_SITE_ENVIRONMENT');
  }

Proposed resolution: 1) Describe possible return values according to the documentation; 2) Optionally, add a @see tag to the documentation page.

danepowell commented 1 year ago

Opened https://github.com/acquia/drupal-environment-detector/pull/63

Be aware that some legacy environments may not conform to that documentation. I think stage used to be (and may still be) a valid environment name in rare cases.