Code Duplication    Length = 14-14 lines in 3 locations

src/ContainerInteropLoggerFactory.php 3 locations

@@ 124-137 (lines=14) @@
121
        }, $processors);
122
    }
123
124
    protected function resolveHandler(string $handlerName) : HandlerInterface
125
    {
126
        $handler = $this->resolveFromContainer($handlerName);
127
128
        if (null === $handler) {
129
            throw InvalidContainerServiceException::forUnresolved('handler', $handlerName);
130
        }
131
132
        if (! $handler instanceof HandlerInterface) {
133
            throw InvalidContainerServiceException::forInvalid('handler', $handlerName, HandlerInterface::class);
134
        }
135
136
        return $handler;
137
    }
138
139
    protected function resolveFormatter(string $formatterName) : FormatterInterface
140
    {
@@ 139-152 (lines=14) @@
136
        return $handler;
137
    }
138
139
    protected function resolveFormatter(string $formatterName) : FormatterInterface
140
    {
141
        $formatter = $this->resolveFromContainer($formatterName);
142
143
        if (null === $formatter) {
144
            throw InvalidContainerServiceException::forUnresolved('formatter', $formatterName);
145
        }
146
147
        if (! $formatter instanceof FormatterInterface) {
148
            throw InvalidContainerServiceException::forInvalid('formatter', $formatterName, FormatterInterface::class);
149
        }
150
151
        return $formatter;
152
    }
153
154
    protected function resolveProcessor(string $processorName) : callable
155
    {
@@ 154-167 (lines=14) @@
151
        return $formatter;
152
    }
153
154
    protected function resolveProcessor(string $processorName) : callable
155
    {
156
        $processor = $this->resolveFromContainer($processorName);
157
158
        if (null === $processor) {
159
            throw InvalidContainerServiceException::forUnresolved('processor', $processorName);
160
        }
161
162
        if (! is_callable($processor)) {
163
            throw InvalidContainerServiceException::forInvalid('processor', $processorName, 'callable');
164
        }
165
166
        return $processor;
167
    }
168
169
    final protected function resolveFromContainer(string $serviceOrFactory)
170
    {