Download the PHP package waffle-commons/contracts without Composer

On this page you can find all versions of the php package waffle-commons/contracts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contracts

demo PHP Version Require PHP CI codecov Latest Stable Version Latest Unstable Version Total Downloads Packagist License

Waffle Contracts Component

Release: 0.1.0-beta6  |  CHANGELOG.md

The Waffle Framework's central contract package. Every other waffle-commons/* component depends only on this package and on its declared PSR interfaces. No component may depend on a sibling's concrete implementation β€” contracts is the line that keeps the ecosystem decoupled.

This package contains interfaces, attributes, enums, exception interfaces, typed constants, and the small set of concrete routing exceptions (RouteNotFoundException, MethodNotAllowedException) shared across components. No business logic ever ships from here.

πŸ†• Beta-2 highlights β€” HTTP method correctness

Beta-1 inheritance

The Beta-1 line introduced the security and HTTP-correctness foundations this package still carries:

πŸ“¦ Installation

🧱 What's inside

Namespace Purpose
Waffle\Commons\Contracts\Attribute Marker attributes (#[Dto]) consumed by the framework's argument resolver.
Waffle\Commons\Contracts\Cache PSR-6 + PSR-16 extension interfaces (CacheInterface, CacheItemPoolInterface, StampedeProtectionInterface).
Waffle\Commons\Contracts\Config ConfigInterface typed getters (getInt, getString, getArray, getBool).
Waffle\Commons\Contracts\Console ConsoleApplicationInterface, CommandInterface, InputInterface, OutputInterface.
Waffle\Commons\Contracts\Constant\Constant Ecosystem-wide typed constants (env names, security levels, attribute keys).
Waffle\Commons\Contracts\Container ContainerInterface extending PSR-11 + ResettableInterface for worker-mode resets.
Waffle\Commons\Contracts\Controller BaseControllerInterface.
Waffle\Commons\Contracts\Core KernelInterface β€” the heart of the request lifecycle.
Waffle\Commons\Contracts\Enum Framework-wide enums (e.g. Failsafe).
Waffle\Commons\Contracts\ErrorHandler ErrorRendererInterface for content-negotiated error rendering.
Waffle\Commons\Contracts\EventDispatcher EventDispatcherInterface, ListenerProviderInterface (PSR-14 extension).
Waffle\Commons\Contracts\Exception Root exception interfaces (ValidationExceptionInterface, etc.).
Waffle\Commons\Contracts\Handler ArgumentResolverInterface, ResponseConverterInterface.
Waffle\Commons\Contracts\Http Framework-specific HTTP factories on top of PSR-7/17 (GlobalsFactoryInterface, ResponseEmitterInterface, ServerRequestFactoryInterface).
Waffle\Commons\Contracts\Parser YamlParserInterface.
Waffle\Commons\Contracts\Pipeline MiddlewareStackInterface (PSR-15 stack).
Waffle\Commons\Contracts\Routing RouterInterface + routing exception interfaces.
Waffle\Commons\Contracts\Runtime RuntimeInterface for FrankenPHP / classic SAPI bootstrap.
Waffle\Commons\Contracts\Security SecurityInterface, SecurityRuleInterface, VoterInterface + #[Voter] / #[Rule] attributes + CSRF attributes.
Waffle\Commons\Contracts\Service ResettableInterface β€” implemented by any service that needs reset between FrankenPHP worker requests.
Waffle\Commons\Contracts\System SystemInterface.
Waffle\Commons\Contracts\Validation ValidatorInterface, ValidationResultInterface, ViolationInterface.

🐘 PHP 8.5 surface

The contracts package is the canonical reference for the framework's PHP 8.5 contract style:

πŸ“ Sample interfaces

KernelInterface β€” the heart of the framework:

ConfigInterface β€” typed config access:

#[Dto] β€” marker attribute for auto-hydrated DTOs:

A DTO consumer in your controller:

🀝 Decoupling rule

Every concrete waffle-commons component must depend on waffle-commons/contracts and on nothing else from the waffle-commons/* namespace, unless explicitly declared in its own composer.json require. This rule is enforced at build time by mago guard perimeters in every component.

🧭 Architectural boundary (mago guard)

contracts is the root of the ecosystem, so its own perimeter (enforced by vendor/bin/mago guard, bundled into composer mago, zero baselines β€” see mago.toml [guard.perimeter]) is the strictest of all: production code under Waffle\Commons\Contracts may depend only on:

It depends on *no other `waffle-commons/package** β€” that is what lets every other component depend on it without creating a cycle. Test code underWaffleTests\Commons\Contractsis unrestricted (@all`).

Structural rules are guarded too: interfaces must be named *Interface, Exception\** classes must end in *Exception, and any Enum\** namespace may hold only enum declarations (see the Decoupling rule above for the ecosystem-wide counterpart).

πŸ§ͺ Testing

πŸ“š Documentation

Full guides live in the central DiΓ‘taxis documentation tree:

πŸ“„ License

MIT β€” see LICENSE.md.


All versions of contracts with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
psr/container Version ^2.0
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0
psr/event-dispatcher Version ^1.0
psr/log Version ^3.0
psr/cache Version ^3.0
psr/http-server-middleware Version ^1.0
psr/simple-cache Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package waffle-commons/contracts contains the following files

Loading the files please wait ...