This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
14
{
15
/**
16
* @var \Archive_Tar
17
*/
18
private $archive;
19
20
/**
21
* @var PackagedResource
22
*/
23
private $container;
24
25
/**
26
* @param PackagedResource $container
27
*/
28
public function __construct(PackagedResource $container)
29
{
30
$this->container = $container;
31
$this->archive = new \Archive_Tar($container->getRelativeUri()->getResource());
32
}
33
34
/**
35
* @return PackagedResource
36
*/
37
public function current()
38
{
39
$resource = $this->getIterator()->current();
40
41
return new PackagedResource(
42
$resource,
43
$this,
44
$this->container->getWriterResolver(),
45
$this->container
46
);
47
}
48
49
/**
50
* @return \ArrayIterator
51
*/
52
protected function buildIterator()
53
{
54
return new MappingArrayIterator($this->archive->listContent(), function ($current) {
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.