# imagify/2.2/classes/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 2.2. 47 lines.

- Page: https://pluginprobe.com/plugins/imagify/2.2/code/classes/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php
- Raw: https://pluginprobe.com/plugins/imagify/2.2/raw/classes/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php
- Modified: 2024-03-06T17:27:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/imagify/2.2/code/classes/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php#L10-L20`.

```php
<?php declare(strict_types=1);

namespace Imagify\Dependencies\League\Container\ServiceProvider;

use Imagify\Dependencies\League\Container\ContainerAwareTrait;

abstract class AbstractServiceProvider implements ServiceProviderInterface
{
    use ContainerAwareTrait;

    /**
     * @var array
     */
    protected $provides = [];

    /**
     * @var string
     */
    protected $identifier;

    /**
     * {@inheritdoc}
     */
    public function provides(string $alias) : bool
    {
        return in_array($alias, $this->provides, true);
    }

    /**
     * {@inheritdoc}
     */
    public function setIdentifier(string $id) : ServiceProviderInterface
    {
        $this->identifier = $id;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getIdentifier() : string
    {
        return $this->identifier ?? get_class($this);
    }
}

```
