Created
October 18, 2018 19:05
-
-
Save mikeschinkel/1557a07e6a75d06ac99f37315898920e to your computer and use it in GitHub Desktop.
The Problems with Pimple - What's wrong with this picture?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$container = new Pimple(); | |
$container['auth'] = function($c) { | |
return new OAuth(); | |
}; | |
$container['db'] = function($c) { | |
return new DB(); | |
}; | |
$container['tweet_service'] = function($c) { | |
$twService = new TwitterService(); | |
$twService->setDB($c['db']); | |
$twService->setOauth($c['oauth']); | |
return $twService; | |
}; | |
$container['soclal_feeds'] = function($c) { | |
$socialFeeds = new SocialFeeds(); | |
$socialFeeds->setTwitterService($c['tweet_servlce']); | |
return $socialFeeds; | |
}; | |
$socialFeeds = $container['social_feeds']; | |
$socialFeeds->getSocialFeeds(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment