Skip to content

Immutable descriptors, directory records and path table records (breaking) - #120

Merged
indy2kro merged 1 commit into
mainfrom
refactor/readonly-descriptors
Oct 6, 2026
Merged

indy2kro merged 1 commit into
mainfrom
refactor/readonly-descriptors

Conversation

@indy2kro

@indy2kro indy2kro commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Makes the parsed structures value objects (UX-04), for the next major release.

Breaking changes

  • all public properties of Descriptor and its subclasses (Volume, PrimaryVolume, SupplementaryVolume, Boot, Partition...), FileDirectory and PathTableRecord are readonly, set when the object is created
  • Descriptor::init() is gone: descriptors parse their bytes in the constructor (new PrimaryVolume($stdId, $version, $bytes, $offset), Factory::create($type, $stdId, $version, $bytes, $offset))
  • descriptor name / type are class constants (getType() unchanged)
  • FileDirectory::init() and PathTableRecord::init() become FileDirectory::read() / PathTableRecord::read() (static, return null at the end of the records); PathTableRecord::setDirectoryNumber() is removed (the number is given to read())
  • IsoFile::$descriptors / $additionalDescriptors are readonly
  • a volume descriptor without a root directory record is now rejected with an exception

Tests: FileDirectory / PathTableRecord / descriptor tests build their objects through the real readers (new Support\Records helper); ImmutabilityTest checks by reflection that every public property of the parsed structures is readonly.

If #117 merges first this may need a trivial rebase (both touch IsoFile).

🤖 Generated with Claude Code

…cords

BREAKING CHANGE: public properties of Descriptor and its subclasses, FileDirectory,
PathTableRecord and IsoFile::$descriptors are readonly and set at construction.
- Descriptor::init() is gone: descriptors parse their bytes in the constructor
- name/type are class constants (Descriptor::getType() is unchanged)
- FileDirectory::init() / PathTableRecord::init() become FileDirectory::read() / PathTableRecord::read() returning null at the end of the records
- PathTableRecord::setDirectoryNumber() is gone (the number is given to read())
- IsoFile::$descriptors / $additionalDescriptors are readonly
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 21 complexity · 0 duplication

Metric Results
Complexity 21
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.89922% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.04%. Comparing base (1f46ce2) to head (a7c6101).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/FileDirectory.php 95.00% 2 Missing ⚠️
src/IsoFile.php 88.88% 1 Missing ⚠️
src/PathTableRecord.php 93.75% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #120      +/-   ##
============================================
- Coverage     97.21%   97.04%   -0.18%     
+ Complexity      582      579       -3     
============================================
  Files            24       22       -2     
  Lines          1329     1318      -11     
============================================
- Hits           1292     1279      -13     
- Misses           37       39       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@indy2kro
indy2kro merged commit 931ca0a into main Oct 6, 2026
8 checks passed
@indy2kro
indy2kro deleted the refactor/readonly-descriptors branch October 7, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant