Skip to content

Commit e162d94

Browse files
committed
cleanup
1 parent cacde1e commit e162d94

File tree

2 files changed

+1
-73
lines changed

2 files changed

+1
-73
lines changed

src/Index/AbstractAggregateIndex.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ public function isStaticComplete(): bool
107107
public function getDefinitions(): \Generator
108108
{
109109
foreach ($this->getIndexes() as $index) {
110-
// foreach ($index->getDefinitions() as $fqn => $definition) {
111-
// yield $fqn => $definition;
112-
// }
113-
114110
yield from $index->getDefinitions();
115111
}
116112
}
@@ -124,10 +120,6 @@ public function getDefinitions(): \Generator
124120
public function getDefinitionsForFqn(string $fqn): \Generator
125121
{
126122
foreach ($this->getIndexes() as $index) {
127-
// foreach ($index->getDefinitionsForFqn($fqn) as $symbolFqn => $definition) {
128-
// yield $symbolFqn => $definition;
129-
// }
130-
131123
yield from $index->getDefinitionsForFqn($fqn);
132124
}
133125
}
@@ -157,10 +149,6 @@ public function getDefinition(string $fqn, bool $globalFallback = false)
157149
public function getReferenceUris(string $fqn): \Generator
158150
{
159151
foreach ($this->getIndexes() as $index) {
160-
// foreach ($index->getReferenceUris($fqn) as $uri) {
161-
// yield $uri;
162-
// }
163-
164152
yield from $index->getReferenceUris($fqn);
165153
}
166154
}

src/Index/Index.php

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ public function isStaticComplete(): bool
103103
*/
104104
public function getDefinitions(): \Generator
105105
{
106-
// foreach ($this->fqnDefinitions as $fqnDefinition) {
107-
// foreach ($fqnDefinition as $fqn => $definition) {
108-
// yield $fqn => $definition;
109-
// }
110-
// }
111-
112106
yield from $this->yieldDefinitionsRecursively($this->definitions);
113107
}
114108

@@ -120,14 +114,10 @@ public function getDefinitions(): \Generator
120114
*/
121115
public function getDefinitionsForFqn(string $fqn): \Generator
122116
{
123-
// foreach ($this->fqnDefinitions[$fqn] ?? [] as $symbolFqn => $definition) {
124-
// yield $symbolFqn => $definition;
125-
// }
126-
127117
$parts = $this->splitFqn($fqn);
128118
if ('' === end($parts)) {
129119
// we want to return all the definitions in the given FQN, not only
130-
// the one matching exactly the FQN.
120+
// the one (non member) matching exactly the FQN.
131121
array_pop($parts);
132122
}
133123

@@ -149,19 +139,6 @@ public function getDefinitionsForFqn(string $fqn): \Generator
149139
*/
150140
public function getDefinition(string $fqn, bool $globalFallback = false)
151141
{
152-
// $namespacedFqn = $this->extractNamespacedFqn($fqn);
153-
// $definitions = $this->fqnDefinitions[$namespacedFqn] ?? [];
154-
155-
// if (isset($definitions[$fqn])) {
156-
// return $definitions[$fqn];
157-
// }
158-
159-
// if ($globalFallback) {
160-
// $parts = explode('\\', $fqn);
161-
// $fqn = end($parts);
162-
// return $this->getDefinition($fqn);
163-
// }
164-
165142
$parts = $this->splitFqn($fqn);
166143
$result = $this->getIndexValue($parts, $this->definitions);
167144

@@ -175,11 +152,6 @@ public function getDefinition(string $fqn, bool $globalFallback = false)
175152

176153
return $this->getDefinition($fqn);
177154
}
178-
179-
// return $result instanceof Definition
180-
// ? $result
181-
// : null
182-
// ;
183155
}
184156

185157
/**
@@ -191,13 +163,6 @@ public function getDefinition(string $fqn, bool $globalFallback = false)
191163
*/
192164
public function setDefinition(string $fqn, Definition $definition)
193165
{
194-
// $namespacedFqn = $this->extractNamespacedFqn($fqn);
195-
// if (!isset($this->fqnDefinitions[$namespacedFqn])) {
196-
// $this->fqnDefinitions[$namespacedFqn] = [];
197-
// }
198-
199-
// $this->fqnDefinitions[$namespacedFqn][$fqn] = $definition;
200-
201166
$parts = $this->splitFqn($fqn);
202167
$this->indexDefinition(0, $parts, $this->definitions, $definition);
203168

@@ -213,17 +178,7 @@ public function setDefinition(string $fqn, Definition $definition)
213178
*/
214179
public function removeDefinition(string $fqn)
215180
{
216-
// $namespacedFqn = $this->extractNamespacedFqn($fqn);
217-
// if (isset($this->fqnDefinitions[$namespacedFqn])) {
218-
// unset($this->fqnDefinitions[$namespacedFqn][$fqn]);
219-
220-
// if (empty($this->fqnDefinitions[$namespacedFqn])) {
221-
// unset($this->fqnDefinitions[$namespacedFqn]);
222-
// }
223-
// }
224-
225181
$parts = $this->splitFqn($fqn);
226-
227182
$this->removeIndexedDefinition(0, $parts, $this->definitions);
228183

229184
unset($this->references[$fqn]);
@@ -324,21 +279,6 @@ public function serialize()
324279
]);
325280
}
326281

327-
/**
328-
* @param string $fqn The symbol FQN
329-
* @return string The namespaced FQN extracted from the given symbol FQN
330-
*/
331-
// private function extractNamespacedFqn(string $fqn): string
332-
// {
333-
// foreach (['::', '->'] as $operator) {
334-
// if (false !== ($pos = strpos($fqn, $operator))) {
335-
// return substr($fqn, 0, $pos);
336-
// }
337-
// }
338-
339-
// return $fqn;
340-
// }
341-
342282
/**
343283
* Returns a Genrerator containing all the into the given $storage recursively.
344284
* The generator yields key => value pairs, eg

0 commit comments

Comments
 (0)