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 | |
| return array( | |
| 'AD' => 'Andorra', | |
| 'AE' => 'United Arab Emirates', | |
| 'AF' => 'Afghanistan', | |
| 'AG' => 'Antigua and Barbuda', | |
| 'AI' => 'Anguilla', | |
| 'AL' => 'Albania', | |
| 'AM' => 'Armenia', | |
| 'AO' => 'Angola', |
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 | |
| use Doctrine\Common\EventSubscriber; | |
| use Doctrine\DBAL\Events; | |
| use Doctrine\DBAL\Event\ConnectionEventArgs; | |
| final class EnableSavepointsListener implements EventSubscriber | |
| { | |
| /** | |
| * {@inheritdoc} |
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 | |
| interface Ham | |
| { | |
| public function halp(\stdClass $obj=null); | |
| } | |
| class Spam implements Ham | |
| { | |
| public function halp(\stdClass $obj) |
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
| {% form_theme form 'theme.html.twig' %} | |
| {# the theme above will take care of rendering the input group #} | |
| {{ form(form) }} |
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 | |
| /** | |
| * The idea here is that there's a singleton-esque thing. We don't want to cause | |
| * side effects like adding actions/filters in a constructor, so we delegate that | |
| * to the `hook` method. `instance` provides a way for things that need to un-hook | |
| * things to get a reference to the "global" instance. | |
| */ | |
| abstract class Base | |
| { |
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 PMG\FromScratch\AppBundle; | |
| use Symfony\Component\HttpKernel\Bundle\Bundle; | |
| final class AppBundle extends Bundle | |
| { | |
| // noop | |
| } |
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
| (loop [rng (range 10)] | |
| (when-let [i (first rng)] | |
| (println (apply str (repeat i i))) | |
| (recur (rest rng)))) |
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
| RewriteEngine on | |
| RewriteRule ^composer\.(lock|json)$ - [F,L] | |
| RewriteRule ^vendor/.*$ - [F,L] |
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 | |
| interface Spam extends \Traversable | |
| { | |
| // ... | |
| } | |
| final class Ham implements Spam, \IteratorAggregate | |
| { | |
| public function getIterator() |
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 | |
| /* | |
| Ideally this would be part of the language: | |
| with (createAnObject() as $object) { | |
| $object->doStuff(); | |
| } | |
| This is just sugar for: |