Просмотр файла vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLeague.php

Размер файла: 794B
  1. <?php
  2.  
  3. namespace Intervention\Image;
  4.  
  5. use League\Container\ServiceProvider\AbstractServiceProvider;
  6.  
  7. class ImageServiceProviderLeague extends AbstractServiceProvider
  8. {
  9. /**
  10. * @var array $config
  11. */
  12. protected $config;
  13.  
  14. /**
  15. * @var array $provides
  16. */
  17. protected $provides = [
  18. 'Intervention\Image\ImageManager'
  19. ];
  20.  
  21. /**
  22. * Constructor.
  23. *
  24. * @param array $config
  25. */
  26. public function __construct($config = [])
  27. {
  28. $this->config = $config;
  29. }
  30.  
  31. /**
  32. * Register the server provider.
  33. *
  34. * @return void
  35. */
  36. public function register()
  37. {
  38. $this->getContainer()->share('Intervention\Image\ImageManager', function () {
  39. return new ImageManager($this->config);
  40. });
  41. }
  42. }