Exemple #1
0
        /// <summary>
        /// Detects the programming platform name and version required by the application in source directory.
        /// </summary>
        /// <param name="context">The repository context.</param>
        /// <returns>The results of language detector operations.</returns>
        public PlatformDetectorResult Detect(RepositoryContext context)
        {
            PlatformDetectorResult detectionResult;

            if (TryGetExplicitVersion(out var explicitVersion))
            {
                detectionResult = new PlatformDetectorResult
                {
                    Platform        = PhpConstants.PlatformName,
                    PlatformVersion = explicitVersion,
                };
            }
            else
            {
                detectionResult = _detector.Detect(context);
            }

            if (detectionResult == null)
            {
                return(null);
            }

            var version = ResolveVersion(detectionResult.PlatformVersion);

            detectionResult.PlatformVersion = version;
            return(detectionResult);
        }
Exemple #2
0
 /// <summary>
 /// Detects the programming platform name and version required by the application in source directory.
 /// </summary>
 /// <param name="context">The repository context.</param>
 /// <returns>The results of language detector operations.</returns>
 public PlatformDetectorResult Detect(RepositoryContext context)
 {
     return(_detector.Detect(context));
 }