Skip to content

Commit 0a66caf

Browse files
committed
Less_SourceMap_Generator: Avoid undefined array index access
Improve documentation of involved class properties Change-Id: Ic16671accdee1307b0d32a67f35f0f12e83aac25
1 parent 08fcdaf commit 0a66caf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/Less/SourceMap/Generator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ class Less_SourceMap_Generator extends Less_Configurable {
7272
/**
7373
* File to content map
7474
*
75-
* @var array
75+
* @var array<string,string>
7676
*/
7777
protected $sources = [];
78+
/** @var array<string,int> */
7879
protected $source_keys = [];
7980

8081
/**
@@ -345,7 +346,7 @@ public function generateMappings() {
345346
* @return int|false
346347
*/
347348
protected function findFileIndex( $filename ) {
348-
return $this->source_keys[$filename];
349+
return $this->source_keys[$filename] ?? false;
349350
}
350351

351352
/**

0 commit comments

Comments
 (0)