8 – Warning: Invalid argument supplied for foreach() in DrupalCoreAssetLibraryDiscoveryParser->buildByExtension()


I get the error :

Warning: Invalid argument supplied for foreach() in
DrupalCoreAssetLibraryDiscoveryParser->buildByExtension() (line 150
of core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php

custom_changes.module >> hook_form_alter

if ($form_id =='user_form') {
        $form('#attached')('library')() = 'custom_changes/user_library';

custom_changes.libraries.yml

user_library:
  version: VERSION
  css:
    theme:
      css/user.css: {}
custom_seven_library:
  version: VERSION
  css:
    theme:
    css/hr.css: {}