Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
ComposerAutoloadGeneratorFactory
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 get
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * Factory, so when creating the object midway through the method, the typical instance can be
5 * substituted with a mock or a stub.
6 *
7 * Contains no conditional logic.
8 *
9 * @see \Composer\Autoload\AutoloadGenerator
10 * @see \BrianHenryIE\Strauss\Pipeline\Autoload\ComposerAutoloadGenerator
11 */
12
13namespace BrianHenryIE\Strauss\Pipeline\Autoload;
14
15use Composer\Autoload\AutoloadGenerator;
16use Composer\EventDispatcher\EventDispatcher;
17
18class ComposerAutoloadGeneratorFactory
19{
20    /**
21     * Get a AutoloadGenerator for creating/recreating the autoload files
22     *
23     * @param string $namespacePrefix
24     * @param EventDispatcher $eventDispatcher
25     */
26    public function get(
27        string $namespacePrefix,
28        EventDispatcher $eventDispatcher
29    ): AutoloadGenerator {
30        return new ComposerAutoloadGenerator(
31            $namespacePrefix,
32            $eventDispatcher
33        );
34    }
35}