Skip to content

pferre/shopping-cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Update your vendors

php composer install -o

Run the unit tests

bin/phpspec run --format=pretty

Run the app

php index.php

Checking the discount tiers

Resolving a discountable tier for a particular product:

$DiscountableProduct = str_replace($name, 'Discountable'.$name, $name);
$handler = new DiscountHandler(new $DiscountableProduct);
$discount = $handler->checkDiscountFor($amount = 80);

Limitations and todo

Format output properly to the console.

Resolve the discount tier implementations properly with polymorphic behaviour. There's a basic implementation of this using the Strategy design pattern.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages