@@ 136-140 (lines=5) @@ | ||
133 | public function delEntry($entryOrIdOrName): Archive |
|
134 | { |
|
135 | if (\is_string($entryOrIdOrName)) { |
|
136 | if (!isset($this->entriesByName[$entryOrIdOrName])) { |
|
137 | throw new \InvalidArgumentException("No entry with name '$entryOrIdOrName' found in this Archive."); |
|
138 | } else { |
|
139 | $index = $this->entriesByName[$entryOrIdOrName]; |
|
140 | } |
|
141 | } |
|
142 | ||
143 | elseif ($entryOrIdOrName instanceof ArchiveEntry) { |
|
@@ 150-154 (lines=5) @@ | ||
147 | } |
|
148 | ||
149 | elseif (\is_int($entryOrIdOrName)) { |
|
150 | if (!isset($this->entries[$entryOrIdOrName])) { |
|
151 | throw new \InvalidArgumentException("No entry with id #$entryOrIdOrName is found in this Archive."); |
|
152 | } else { |
|
153 | $index = (int)$entryOrIdOrName; |
|
154 | } |
|
155 | } |
|
156 | ||
157 | else { |