Sha256: 0943a5794889cbee2583ed1b82e1fc9962f72a15c52fe0af0992a0c66d370fbf

Contents?: true

Size: 573 Bytes

Versions: 38

Compression:

Stored size: 573 Bytes

Contents

<?php

declare(strict_types=1);

namespace Dependabot\Composer;

use Composer\Package\Locker;

class Hasher
{
    /**
     * @throws \RuntimeException
     */
    public static function getContentHash(array $args): string
    {
        [$workingDirectory] = $args;

        $config = $workingDirectory . '/composer.json';

        $contents = file_get_contents($config);

        if (!is_string($contents)) {
            throw new \RuntimeException(sprintf('Failed to load contents of "%s".', $config));
        }

        return Locker::getContentHash($contents);
    }
}

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
dependabot-composer-0.118.8 helpers/src/Hasher.php
dependabot-composer-0.118.7 helpers/src/Hasher.php
dependabot-composer-0.118.6 helpers/src/Hasher.php
dependabot-composer-0.118.5 helpers/src/Hasher.php
dependabot-composer-0.118.4 helpers/src/Hasher.php
dependabot-composer-0.118.3 helpers/src/Hasher.php
dependabot-composer-0.118.2 helpers/src/Hasher.php
dependabot-composer-0.118.1 helpers/src/Hasher.php
dependabot-composer-0.118.0 helpers/src/Hasher.php
dependabot-composer-0.117.11 helpers/src/Hasher.php
dependabot-composer-0.117.10 helpers/src/Hasher.php
dependabot-composer-0.117.9 helpers/src/Hasher.php
dependabot-composer-0.117.8 helpers/src/Hasher.php
dependabot-composer-0.117.7 helpers/src/Hasher.php
dependabot-composer-0.117.6 helpers/src/Hasher.php
dependabot-composer-0.117.5 helpers/src/Hasher.php
dependabot-composer-0.117.4 helpers/src/Hasher.php
dependabot-composer-0.117.3 helpers/src/Hasher.php
dependabot-composer-0.117.2 helpers/src/Hasher.php
dependabot-composer-0.117.1 helpers/src/Hasher.php