77use PhpParser \Node ;
88use Psr \Log \LoggerInterface ;
99
10- class SqliteStorage
10+ class SqliteStorage implements StorageInterface
1111{
1212 private \PDO $ pdo ;
1313
@@ -261,17 +261,17 @@ private function insertNewFile(array $fileData, ?bool $isEntry): int
261261
262262 public function addSymbol (
263263 int $ fileId ,
264- string $ type ,
265- string $ name ,
264+ string $ symbolType ,
265+ string $ symbolName ,
266266 string $ fqn ,
267267 ?string $ namespace = null ,
268268 ?string $ visibility = null ,
269269 bool $ isAbstract = false ,
270- bool $ isFinal = false ,
271- ): int {
270+ bool $ isFinal = false
271+ ): void {
272272 $ stmt = $ this ->pdo ->prepare ('
273273 INSERT OR REPLACE INTO symbols (
274- file_id, symbol_type, symbol_name, fqn, namespace,
274+ file_id, symbol_type, symbol_name, fqn, namespace,
275275 visibility, is_abstract, is_final
276276 ) VALUES (
277277 :file_id, :symbol_type, :symbol_name, :fqn, :namespace,
@@ -281,46 +281,44 @@ public function addSymbol(
281281
282282 $ stmt ->execute ([
283283 ':file_id ' => $ fileId ,
284- ':symbol_type ' => $ type ,
285- ':symbol_name ' => $ name ,
284+ ':symbol_type ' => $ symbolType ,
285+ ':symbol_name ' => $ symbolName ,
286286 ':fqn ' => $ fqn ,
287287 ':namespace ' => $ namespace ,
288288 ':visibility ' => $ visibility ,
289289 ':is_abstract ' => $ isAbstract ? 1 : 0 ,
290290 ':is_final ' => $ isFinal ? 1 : 0 ,
291291 ]);
292-
293- return (int ) $ this ->pdo ->lastInsertId ();
294292 }
295293
296294 public function addDependency (
297295 int $ sourceFileId ,
298- string $ type ,
299- ?string $ targetSymbol ,
296+ ?int $ targetFileId ,
297+ string $ dependencyType ,
298+ ?string $ targetSymbol = null ,
300299 ?int $ lineNumber = null ,
301300 bool $ isConditional = false ,
302- ?string $ context = null ,
303- ): int {
301+ ?string $ context = null
302+ ): void {
304303 $ stmt = $ this ->pdo ->prepare ('
305304 INSERT INTO dependencies (
306- source_file_id, dependency_type, target_symbol,
305+ source_file_id, target_file_id, dependency_type, target_symbol,
307306 line_number, is_conditional, context
308307 ) VALUES (
309- :source_file_id, :dependency_type, :target_symbol,
308+ :source_file_id, :target_file_id, : dependency_type, :target_symbol,
310309 :line_number, :is_conditional, :context
311310 )
312311 ' );
313312
314313 $ stmt ->execute ([
315314 ':source_file_id ' => $ sourceFileId ,
316- ':dependency_type ' => $ type ,
315+ ':target_file_id ' => $ targetFileId ,
316+ ':dependency_type ' => $ dependencyType ,
317317 ':target_symbol ' => $ targetSymbol ,
318318 ':line_number ' => $ lineNumber ,
319319 ':is_conditional ' => $ isConditional ? 1 : 0 ,
320320 ':context ' => $ context ,
321321 ]);
322-
323- return (int ) $ this ->pdo ->lastInsertId ();
324322 }
325323
326324 public function addAutoloadRule (string $ type , string $ path , ?string $ prefix = null , int $ priority = 100 ): void
0 commit comments