Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JsonManipulator.php

function JsonManipulator::removeProperty

File

vendor/composer/composer/src/Composer/Json/JsonManipulator.php, line 203

Class

JsonManipulator
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Json

Code

public function removeProperty(string $name) : bool {
    if (strpos($name, 'suggest.') === 0) {
        return $this->removeSubNode('suggest', substr($name, 8));
    }
    if (strpos($name, 'extra.') === 0) {
        return $this->removeSubNode('extra', substr($name, 6));
    }
    if (strpos($name, 'scripts.') === 0) {
        return $this->removeSubNode('scripts', substr($name, 8));
    }
    if (strpos($name, 'autoload.') === 0) {
        return $this->removeSubNode('autoload', substr($name, 9));
    }
    if (strpos($name, 'autoload-dev.') === 0) {
        return $this->removeSubNode('autoload-dev', substr($name, 13));
    }
    return $this->removeMainKey($name);
}
RSS feed
Powered by Drupal