You are here

public static function ScaffoldOptions::create in Drupal 10

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/ScaffoldOptions.php \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions::create()
  2. 9 composer/Plugin/Scaffold/ScaffoldOptions.php \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions::create()

Creates a scaffold options object.

Parameters

array $extras: The contents of the 'extras' section.

Return value

self The scaffold options object representing the provided scaffold options

5 calls to ScaffoldOptions::create()
AppendOpTest::testProcess in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/AppendOpTest.php
@covers ::process
ManageOptions::packageOptions in composer/Plugin/Scaffold/ManageOptions.php
Gets the scaffold options for the stipulated project.
ReplaceOpTest::testEmptyFile in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php
@covers ::process
ReplaceOpTest::testProcess in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php
@covers ::process
SkipOpTest::testProcess in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php
@covers ::process

File

composer/Plugin/Scaffold/ScaffoldOptions.php, line 66

Class

ScaffoldOptions
Per-project options from the 'extras' section of the composer.json file.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public static function create(array $extras) {
  $options = static::hasOptions($extras) ? $extras['drupal-scaffold'] : [];
  return new self($options);
}