This file contains hidden or 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 | |
| class RussianDependencyRoulettePimple extends Pimple | |
| { | |
| public function offsetGet($id) | |
| { | |
| return parent::offsetGet(reset(shuffle($this->keys()))); | |
| } | |
| } |
This file contains hidden or 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 | |
| /** | |
| * Ideas for parameter converters | |
| * | |
| * I've used the word argument here rather than convert or converter, | |
| * because there may not be any converting as such. It may be that things are | |
| * plucked out of the request etc | |
| * | |
| * The idea being that some of the controller arguments come from the url, |
This file contains hidden or 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
| #!/usr/bin/env php | |
| <?php | |
| $app = require __DIR__ . '/../app/bootstrap.php'; | |
| $routes = $app['routes']->all(); | |
| $data = array(); | |
| foreach($routes as $route) { |
This file contains hidden or 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
| . | |
| ├── app | |
| ├── bin | |
| ├── chef | |
| ├── data | |
| ├── docs | |
| ├── features | |
| ├── migrations | |
| ├── public | |
| ├── src |
This file contains hidden or 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 | |
| $app = include __DIR__.'/../app/bootstrap.php'; | |
| $app->run(); |
This file contains hidden or 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 | |
| public function __call($name, array $args) | |
| { | |
| $this->setOption('_' . $name, $args); | |
| return $this; | |
| } |
This file contains hidden or 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 | |
| namespace Dave { | |
| class IsAce {} | |
| } | |
| namespace { | |
| var_dump(class_exists('IsAce', false)); // bool(false) | |
| } |
This file contains hidden or 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
| diff --git a/silex/app.php b/silex/app.php | |
| index c72525c..172d4a1 100644 | |
| --- a/silex/app.php | |
| +++ b/silex/app.php | |
| @@ -16,8 +16,6 @@ $app = new Application(); | |
| */ | |
| $app['locale'] = 'en'; | |
| $app['session.default_locale'] = $app['locale']; | |
| -$app['translator.messages'] = require __DIR__ . '/resources/locales/translations.php'; | |
| -$app['languages'] = array_keys($app['translator.messages']); |
This file contains hidden or 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
| #!/bin/zsh | |
| autoload colors | |
| colors | |
| function test_version() { | |
| echo "Attempting to test against Symfony $1" | |
| git reset HEAD --hard |
This file contains hidden or 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 | |
| class FooConverter | |
| { | |
| public function convert($value) {} | |
| } | |
| $app = new Silex\Application; | |
| $app['converters.foo'] = function($value) { |