Problem/Motivation

  /**
   * ScaffoldFilePath constructor.
   *
   * @param string $path_type
   *   The type of scaffold file this is, 'src' or 'dest'.
   * @param string $package_name
   *   The name of the package containing the file.
   * @param string $rel_path
   *   The relative path to the file.
   * @param string $full_path
   *   The full path to the file.
   */
  public function __construct($path_type, $package_name, $rel_path, $full_path) {

but:

    return new ScaffoldFilePath('autoload', $package_name, $dest_rel_path, $dest_full_path);

ScaffoldFilePath should document that 'autoload' is allowed as well.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#11 3207111-11.patch822 bytesswatichouhan012

Issue fork drupal-3207111

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

guilhermevp’s picture

Should 'autoload' be documented as '(optional)'?

joachim’s picture

No, the thing here is that the $path_type parameter is documented as only accepting one of 'src' or 'dest', but that's not true, as 'autoload' is also a possible value.

guilhermevp’s picture

Assigned: Unassigned » guilhermevp

guilhermevp’s picture

Status: Active » Needs review

Thanks @joachim!

Created MR, please review!

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks!

alexpott’s picture

Title: autoloadPath() violates the spec of ScaffoldFilePath::__construct() » Improve ScaffoldFilePath::__construct() documentation
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  /**
   * The type of scaffold file this is, 'src' or 'dest'.
   *
   * @var string
   */
  protected $type;

This needs fixing too...

swatichouhan012’s picture

Status: Needs work » Needs review
StatusFileSize
new822 bytes

Created PR with include fixes of #10, please review.

guilhermevp’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @swatichouhan012! Patch now complies with #10 request. Moving to RTBC.

guilhermevp’s picture

Assigned: guilhermevp » Unassigned
alexpott’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed dc9a09e802 to 9.3.x and 4a445e8290 to 9.2.x. Thanks!

  • alexpott committed dc9a09e on 9.3.x
    Issue #3207111 by guilhermevp, swatichouhan012, joachim: Improve...

  • alexpott committed 4a445e8 on 9.2.x
    Issue #3207111 by guilhermevp, swatichouhan012, joachim: Improve...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.