Skip to content
Academy
0/24

Routes

On this page

Fundamentals · Unit 2 of 4

Contracts before coupling

A plugin declares what it provides and what it requires. The resolver can validate the whole set before boot because it works with an explicit graph, not with hidden side effects.

Beginner20 min

By the end, you'll be able to

  • Recognize provides/requires
  • Detect a missing capability and a cycle

Understand

A plugin declares what it provides and what it requires. The resolver can validate the whole set before boot because it works with an explicit graph, not with hidden side effects.

Boot order is a consequence of the graph. If a capability is missing or a cycle exists, the system must fail with evidence and before it serves traffic. The resolver's report names the cycle in its own vocabulary: in a cycle nobody can go first, so the cycle members are excluded from loadOrder[] and the graph blocks (MILPA_DEPENDENCY_CYCLE) until the cycle is broken.

When several providers claim the same id, the resolver separates two cases. An exclusive id claimed by two or more providers blocks the graph (MILPA_CAPABILITY_CONFLICT): the resolver refuses to pick silently, because a hidden choice is exactly the invisible architecture it exists to prevent. Among multiple NON-exclusive providers the choice is legitimate, and priority makes it deterministic: the highest priority wins (absent = 0). priority orders a permitted choice; it does not rescue an exclusive conflict.

See

Break and repair the planting

Trigger a cycle, inspect the block and return to a valid order.

Do

Run the practice in your checkout and keep the output as evidence.

terminal
$php bin/coa validate

Verify

Show that you can apply the unit. Progress only advances once you pass the assessment.

Criteria assessed

  • Place validation before boot.
  • Justify the valid order from the graph, not from a manual list.

Graded assessment

Solve the 4 scenarios. This unit requires 4 of 4 correct answers.

0 attempts
Question 1 of 4ReportsPlugin declares that it requires ExporterInterface, but no configured plugin provides it. What result should php bin/coa validate produce?
Question 2 of 4IdentityPlugin provides identity; OrdersPlugin requires identity and provides orders; NotificationsPlugin requires orders. Which boot order respects the graph?
Question 3 of 4PluginA provides alpha and requires beta; PluginB provides beta and requires alpha. The kernel tries to boot that host. What is the architecturally correct result?
Question 4 of 4CachePlugin and RedisPlugin both provide the cache capability, which is marked exclusive. RedisPlugin declares priority 10; CachePlugin declares no priority. What should the resolver report?

Grading validates answers in this browser; it doesn't certify identity.

Primary sources

Content verified: 2026-07-12