Skip to content

Instantly share code, notes, and snippets.

@m4tthumphrey
Created November 9, 2016 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4tthumphrey/fc75c699d4b77741501b64ff09932c37 to your computer and use it in GitHub Desktop.
Save m4tthumphrey/fc75c699d4b77741501b64ff09932c37 to your computer and use it in GitHub Desktop.
<?php
// this should be called the first time 'manager' is resolved from the container
$container->get('manager')->registerPolicy(new Policy());
<?php
class Manager
{
protected $policies = [];
public function registerPolicy(PolicyInterface $policy)
{
$this->policies[$policy->getName()] = $policy;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment