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

Breadcrumb

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

function GenericRule::__toString

Formats a rule as a string of the format (Literal1|Literal2|...)

Overrides Rule::__toString

File

vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php, line 78

Class

GenericRule
@author Nils Adermann <naderman@naderman.de>

Namespace

Composer\DependencyResolver

Code

public function __toString() : string {
    $result = $this->isDisabled() ? 'disabled(' : '(';
    foreach ($this->literals as $i => $literal) {
        if ($i !== 0) {
            $result .= '|';
        }
        $result .= $literal;
    }
    $result .= ')';
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal