public static function createFromLock(string $name, array $packageData): PackageContract
    {
        $keyToFunctionMappers = [
            'parent'          => 'setParentName',
            'is-dev'          => 'setIsDev',
            'url'             => 'setUrl',
            'operation'       => 'setOperation',
            'type'            => 'setType',
            'requires'        => 'setRequires',
            'automatic-extra' => 'setConfig',
            'autoload'        => 'setAutoload',
            'created'         => 'setTime',
        ];

        $package = new static($name, $packageData['version']);

        foreach ($packageData as $key => $data) {
            if ($data !== null && isset($keyToFunctionMappers[$key])) {
                $package->{$keyToFunctionMappers[$key]}($data);
            }
        }

        return $package;
    }