[FEATURE] Support for musical sources (and prototype annotations)
Could you please add the following lines to .github/codeql.yml in order to exempt GridStack and Verovio from automated quality checks?
- Resources/Public/JavaScript/Gridstack
- Resources/Public/JavaScript/Verovio
OK, now there are more errors visible formerly hidden by a faulty documentation: There are some cases of calls to non-existing methods and/or properties across multiple files. The reason is, that up until your last changes, there were @property-read ... entries in the docBlock of AbstractDocument for properties which were not actually available in that class (i.e. the measure-related properties). But because of those entries, PHPStan didn't recognize it as an error when those non-existing properties were called. Now that the documentation is correct, those errors are found.
To get rid of them, you have to make sure that the measure-related features are only used for METS documents. So wherever the error arises, you have to check if the given document is a MetsDocument and not just an AbstractDocument before calling any measure-related properties or methods.
Otherwise we would run into fatal errors whenever someone tries to access an IiifManifest.
OK, almost there! ;) Only 4 files still have issues:
- [x]
Classes/Common/DocumentAnnotation.php, line 23: This needs a class docBlock - [x]
Classes/Common/MetsDocument.php, line 284: The@seereference doesn't make sense, because the target doesn't exist - [x]
Classes/Controller/PageViewController.php, lines 544 + 548: Please check if variable$docMeasuresis set (which it is only forMetsDocument) - [x]
Resources/Public/JavaScript/PageView/ScoreControl.js, line 405: Add a semicolon at the end of the statement
In this case, $docMeasures should always be set, as the getMeasures() method always returns an array. However, the individual components of the array would then be empty if it is not a MetsDocument. Should this be handled differently?