1 | <?php |
||
21 | class Archive implements ArchiveInterface |
||
22 | { |
||
23 | /** |
||
24 | * The path to the archive |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $path; |
||
29 | |||
30 | /** |
||
31 | * The archive adapter |
||
32 | * |
||
33 | * @var AdapterInterface |
||
34 | */ |
||
35 | protected $adapter; |
||
36 | |||
37 | /** |
||
38 | * An array of archive members |
||
39 | * |
||
40 | * @var MemberInterface[] |
||
41 | */ |
||
42 | protected $members = array(); |
||
43 | |||
44 | /** |
||
45 | * @var ResourceInterface |
||
46 | */ |
||
47 | protected $resource; |
||
48 | |||
49 | /** |
||
50 | * |
||
51 | * @var ResourceManager |
||
52 | */ |
||
53 | protected $manager; |
||
54 | |||
55 | /** |
||
56 | * Constructor |
||
57 | * |
||
58 | * @param ResourceInterface $resource Path to the archive |
||
59 | * @param AdapterInterface $adapter An archive adapter |
||
60 | * @param ResourceManager $manager The resource manager |
||
61 | */ |
||
62 | public function __construct(ResourceInterface $resource, AdapterInterface $adapter, ResourceManager $manager) |
||
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | public function count() |
||
76 | |||
77 | /** |
||
78 | * Returns an Iterator for the current archive |
||
79 | * |
||
80 | * This method implements the IteratorAggregate interface. |
||
81 | * |
||
82 | * @return \ArrayIterator|MemberInterface[] An iterator |
||
83 | */ |
||
84 | public function getIterator() |
||
88 | |||
89 | /** |
||
90 | * @inheritdoc |
||
91 | */ |
||
92 | public function getMembers() |
||
96 | |||
97 | /** |
||
98 | * @inheritdoc |
||
99 | */ |
||
100 | public function addMembers($sources, $recursive = true) |
||
106 | |||
107 | /** |
||
108 | * @inheritdoc |
||
109 | */ |
||
110 | public function removeMembers($sources) |
||
116 | |||
117 | /** |
||
118 | * @inheritdoc |
||
119 | */ |
||
120 | public function extract($toDirectory) |
||
126 | |||
127 | /** |
||
128 | * @inheritdoc |
||
129 | */ |
||
130 | public function extractMembers($members, $toDirectory = null) |
||
136 | } |
||
137 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.