| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | // phpcs:ignoreFile |
| 3 | 3 | /* |
| 4 | - * This is a modified version of Pimple, a dependency injection container for PHP originally developed by Fabien Potencier. | |
| 4 | + * This file is part of Pimple. | |
| 5 | 5 | * |
| 6 | 6 | * Copyright (c) 2009 Fabien Potencier |
| 7 | 7 | * |
| 8 | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| @@ -251,6 +251,24 @@ | ||
| 251 | 251 | * @return array An array of value names |
| 252 | 252 | */ |
| 253 | 253 | public function keys() { |
| 254 | 254 | return array_keys( $this->values ); |
| 255 | + } | |
| 256 | + | |
| 257 | + /** | |
| 258 | + * Registers a service provider. | |
| 259 | + * | |
| 260 | + * @param ServiceProviderInterface $provider A ServiceProviderInterface instance | |
| 261 | + * @param array $values An array of values that customizes the provider | |
| 262 | + * | |
| 263 | + * @return static | |
| 264 | + */ | |
| 265 | + public function register( ServiceProviderInterface $provider, array $values = array() ) { | |
| 266 | + $provider->register( $this ); | |
| 267 | + | |
| 268 | + foreach ( $values as $key => $value ) { | |
| 269 | + $this[ $key ] = $value; | |
| 270 | + } | |
| 271 | + | |
| 272 | + return $this; | |
| 255 | 273 | } |
| 256 | 274 | } |