Skip to content
CREED
Menu

Quick start#

This page takes you from an empty project to two real answers from the CREED reader in four steps.

Steps#

  1. Require it. Add CREED to your project.

    composer require waynestate/creed
    
  2. Load the bundled policy. The package ships its policy file, and Policy::bundled() loads it.

    use Waynestate\Creed\Policy;
    
    $policy = Policy::bundled();
    

    Expected result: a loaded policy. origin() says where it came from.

  3. Ask stateOf. What state is PHP 8.2 in, on this date?

    use Waynestate\Creed\State;
    
    $state = $policy->stateOf('php', '8.2', new DateTimeImmutable('2026-10-27'));
    // State::Security
    

    Expected result: State::Security. The answer is the state of that version on that date, nothing else.

  4. Ask oldestSupported. What is the oldest PHP an app may declare?

    $floor = $policy->oldestSupported('php', new DateTimeImmutable('2026-10-27'));
    // '8.2'
    

    Expected result: '8.2', the lowest version still Active or Security.

What you built#

Two questions, two stamped answers: the state of a version on a date, and the floor an app may declare. One last time: the reader answers, it does not guess.

Next steps#