Skip to content

StaticReflectionParser is dumb, assumes Class::class references are class level #744

Closed
@heddn

Description

@heddn

If I use the below PHP class structure, then parsing the annotations will always return an empty class level annotation. The current HEAD of https://www.drupal.org/project/migrate_source_csv is broken right now using this pattern. It is a sneaky breakage, because Unit tests pass. It is only when I run integration tests that is breaks.

See https://www.drupal.org/node/2818891

/**
 * Source for CSV.
 *
 * @MigrateSource(
 *   id = "csv"
 * )
 */
class CSV extends SourcePluginBase {

  protected $fileClass = '';

  /**
   * {@inheritdoc}
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration) {
    $this->fileClass = empty($configuration['file_class']) ? CSVFileObject::class : $configuration['file_class'];
  }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions