Skip to content

The install says which plugin, and what happens without it - #39

Merged
fabeat merged 1 commit into
mainfrom
feature/patch-requirement
Oct 30, 2026
Merged

fabeat merged 1 commit into
mainfrom
feature/patch-requirement

Conversation

@fabeat

@fabeat fabeat commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

The install says which plugin, and what happens without it.

What was wrong

The README said a consumer "has to allow a plugin" and named cweagans/composer-patches two sentences later. It said the library "refuses to work", which is not something a consumer can act on. And it listed three of the five fixes the patch adds, without saying what the other two are for, or why the check asks for all five in both directions.

What the README says now

  • The requirement names the plugin where the requirement is stated: the project that installs this one has to allow cweagans/composer-patches.
  • The consequence is precise: without that line the install stops with Composer's own message naming the plugin, and a deck converted against an unpatched PHPPresentation raises MarkdownPresentation\Exception\UnpatchedDependency, whose message names the plugin as well.
  • The five fixes are named, each with the direction that needs it and what it is for:
Method Needed by What it is for
Table::setFirstRow the writer whether the first row of a table is its header
AutoShape::setRoundRectCorner the writer how round the corners of a rounded rectangle are
RichText::setDescription the writer and the reader the description a shape carries: the writer sets it, the reader reads it back
PowerPoint2007::zipPath the reader the path a picture was read from, inside the package
Gd::setContents the reader the bytes a picture was read from, as the package holds them

and why the check asks for all five in either direction: a package that carries only some is refused rather than half-worked. What is missing either fails somewhere else — naming a method rather than the reason — or is quietly left out of the deck that comes back.

Nothing promises the patch goes away.

The claims

tests/Readme/installation.php already read the README and the manifest, so that what is asked of a consumer follows the library rather than the other way round. Three claims are added:

  • the README names the plugin in the sentence that states the requirement;
  • the README says the install stops, and names the exception a conversion raises;
  • the README names every method the library requires — read out of src/Fixes.php by reflection, so the list follows the code and cannot rot when the patch changes.

Each was shown red by editing the README (and, for the third, src/Fixes.php) and reverting: the old README fails the first claim too.

Before v0.3.0

This has to land before the tag, so it ships in the release.

The README's requirement said "a plugin" and named it two sentences
later, so a consumer who stopped at the requirement did not know what to
allow, and "the library refuses to work" said nothing about what they
would meet.

The requirement names cweagans/composer-patches where it is stated, and
the page says what follows: the install stops with Composer's own
message, and a conversion against an unpatched PHPPresentation raises
MarkdownPresentation\Exception\UnpatchedDependency, whose message names
the plugin as well.

The page also names the five methods the patch adds and which direction
needs each, because the check asks for all five in either direction and
refuses a package that carries only some: what is missing fails
somewhere else, naming a method rather than the reason, or is quietly
left out of the deck that comes back.

The guard reads the required methods out of Fixes::REQUIRED by
reflection, so a patch that grows a method makes the page a list of the
methods there are.
@sonarqubecloud

Copy link
Copy Markdown

@fabeat
fabeat merged commit b5620e9 into main Oct 30, 2026
8 checks passed
@fabeat
fabeat deleted the feature/patch-requirement branch October 30, 2026 10:58
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