Wikimedia\Composer\Merge\PluginState::setLocked PHP Метод

setLocked() публичный Метод

Set the locked flag
public setLocked ( boolean $flag )
$flag boolean
    public function setLocked($flag)
    {
        $this->locked = (bool) $flag;
    }

Usage Example

Пример #1
0
 /**
  * Handle an event callback following installation of a new package by
  * checking to see if the package that was installed was our plugin.
  *
  * @param PackageEvent $event
  */
 public function onPostPackageInstall(PackageEvent $event)
 {
     $op = $event->getOperation();
     if ($op instanceof InstallOperation) {
         $package = $op->getPackage()->getName();
         if ($package === self::PACKAGE_NAME) {
             $this->logger->info('composer-merge-plugin installed');
             $this->state->setFirstInstall(true);
             $this->state->setLocked($event->getComposer()->getLocker()->isLocked());
         }
     }
 }