PHPackages                             vasildakov/duck - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vasildakov/duck

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vasildakov/duck
===============

A PHP duck model demonstrating composition over inheritance.

v1.0.0(3mo ago)00MITPHPPHP ^8.4CI passing

Since Mar 13Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/vasildakov/duck)[ Packagist](https://packagist.org/packages/vasildakov/duck)[ RSS](/packages/vasildakov-duck/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Duck
====

[](#duck)

[![CI](https://github.com/vasildakov/duck/actions/workflows/ci.yml/badge.svg)](https://github.com/vasildakov/duck/actions/workflows/ci.yml)[![PHP Version Require](https://camo.githubusercontent.com/236587b21612504e48a9d6f39e46f3ed7cdecc69c89a73922cedd9d70945429c/68747470733a2f2f706f7365722e707567782e6f72672f766173696c64616b6f762f6475636b2f726571756972652f706870)](https://packagist.org/packages/vasildakov/duck)[![Latest Stable Version](https://camo.githubusercontent.com/ce897399421f0222cc92e8f9e3840590b4f9c3adc4ad0960f5c263205d7c2608/68747470733a2f2f706f7365722e707567782e6f72672f766173696c64616b6f762f6475636b2f762f737461626c65)](https://packagist.org/packages/vasildakov/duck)[![License](https://camo.githubusercontent.com/fb494f4615da0d81572c8b7d822448af213f04e725af8cd5d2bf2b4ec5588ad0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f766173696c64616b6f762f6475636b)](LICENSE)[![Coverage Status](https://camo.githubusercontent.com/d00ebe56ae8bf3269867cbdb25e083954a27b06f7aadeddb25dc6f8ef17ba4e4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f766173696c64616b6f762f6475636b2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/vasildakov/duck?branch=master)

Overview
--------

[](#overview)

Duck is a small educational PHP package that demonstrates the composition-over-inheritance design principle using a duck behavior model.

Instead of hardcoding behavior in class hierarchies, each duck is composed from interchangeable fly and quack strategies. This keeps behavior explicit, testable, and easy to extend.

Installation
------------

[](#installation)

```
composer require vasildakov/duck
```

Quick Example
-------------

[](#quick-example)

```
