src/Composer/ComposerJson.php
public function setLock(PackageInterface $package, $state)
    {
        if ((bool) $state) {
            return $this->lockPackage($package);
        }

        return $this->unlockPackage($package);
    }
public function setLock(PackageInterface $package, $state)
    {
        if ((bool) $state) {
            return $this->lockPackage($package);
        }

        return $this->unlockPackage($package);
    }
public function setLock ( PackageInterface $ package , $ state ) { if ( ( bool ) $ state ) { return $ this -> lockPackage ( $ package ) ; } return $ this -> unlockPackage ( $ package ) ; }
Set the locking state for the passed package.

@param PackageInterface $package The package to lock.

@param bool             $state   The desired state.

@return ComposerJson
Set the locking state for the passed package .