Skip to content

Commit e696041

Browse files
committed
Restore null default for globalBasename
It was changed in 3e2fad5, I am not sure why, I think it might be to avoid the extra conditions / complexity I'm adding here. What I know is that it makes a guard condition in FileDriver::initialize() useless, most likely resulting in persistence looking for a file with a name consisting only in an extension (.php, .yml…).
1 parent 267cd9f commit e696041

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Persistence/Mapping/Driver/FileDriver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ abstract class FileDriver implements MappingDriver
3333
*/
3434
protected $classCache;
3535

36-
/** @var string */
37-
protected $globalBasename = '';
36+
/** @var string|null */
37+
protected $globalBasename = null;
3838

3939
/**
4040
* Initializes a new FileDriver that looks in the given path(s) for mapping
@@ -132,7 +132,7 @@ public function getAllClassNames()
132132
$this->initialize();
133133
}
134134

135-
if ($this->classCache === []) {
135+
if ($this->classCache === [] && $this->globalBasename !== null) {
136136
return $this->locator->getAllClassNames($this->globalBasename);
137137
}
138138

@@ -144,7 +144,7 @@ public function getAllClassNames()
144144

145145
return array_values(array_unique(array_merge(
146146
$keys,
147-
$this->locator->getAllClassNames($this->globalBasename)
147+
$this->globalBasename === null ? [] : $this->locator->getAllClassNames($this->globalBasename)
148148
)));
149149
}
150150

0 commit comments

Comments
 (0)