Problem/Motivation

The phpstan CI job now fails on the 9.2.x branch with 5 drupal.symfonyYamlParse violations:

src/Config/ConfigBit.php
  216, 605, 782, 834
varbase.profile
  605
Avoid calling Symfony\Component\Yaml\Yaml::parse() directly.
Use \Drupal\Component\Serialization\Yaml::decode() instead, which handles
exceptions consistently and applies the correct parse flags.

This is not a regression in the code — the branch's last green pipeline was 879539 on 2026-07-07 at commit 3ef36fed, and the files have not changed since. The Drupal phpstan rule set became stricter, so a previously-passing branch now fails. It currently blocks the Varbase 9.2.1 release (see the release MR !74, whose own diff only touches composer.json and varbase.info.yml).

Steps to reproduce

Run the phpstan job on the 9.2.x branch, or:

./vendor/bin/phpstan analyse -c web/profiles/custom/varbase/phpstan.neon

Proposed resolution

Replace the Symfony YAML parser with Drupal's serialization wrapper in both files — swap the use Symfony\Component\Yaml\Yaml; import for use Drupal\Component\Serialization\Yaml; and change the five Yaml::parse(...) calls to Yaml::decode(...).

Note the one behavioural difference to check while reviewing: Yaml::decode() throws Drupal\Component\Serialization\Exception\InvalidDataTypeException rather than Symfony's ParseException, so any surrounding catch blocks need to match.

AI-Generated: Yes

Remaining tasks

  • ✅ File an issue
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ✅ Release

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A

Issue fork varbase-3616860

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

rajab natshah created an issue. See original summary.

  • rajab natshah committed 7dbbc6e7 on 9.2.x
    fix: #3616860 Use the Drupal serialization Yaml decoder instead of...
rajab natshah’s picture

Issue tags: +varbase-9.2.1
rajab natshah’s picture

✅ Released varbase-9.2.1

rajab natshah’s picture

Issue summary: View changes
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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