@@ -274,13 +274,13 @@ private function findWrongBundleOverrides(): array
274
274
$ alternatives = array ();
275
275
$ bundleNames = array ();
276
276
277
- if ($ this ->rootDir ) {
277
+ if ($ this ->rootDir && $ this -> projectDir ) {
278
278
$ folders = glob ($ this ->rootDir .'/Resources/*/views ' , GLOB_ONLYDIR );
279
279
$ relativePath = ltrim (substr ($ this ->rootDir .'/Resources/ ' , \strlen ($ this ->projectDir )), DIRECTORY_SEPARATOR );
280
280
$ bundleNames = array_reduce (
281
281
$ folders ,
282
282
function ($ carry , $ absolutePath ) use ($ relativePath ) {
283
- if (null !== $ this -> projectDir && 0 === strpos ($ absolutePath , $ this ->projectDir )) {
283
+ if (0 === strpos ($ absolutePath , $ this ->projectDir )) {
284
284
$ name = basename (\dirname ($ absolutePath ));
285
285
$ path = $ relativePath .$ name ;
286
286
$ carry [$ name ] = $ path ;
@@ -292,13 +292,13 @@ function ($carry, $absolutePath) use ($relativePath) {
292
292
);
293
293
}
294
294
295
- if ($ this ->twigDefaultPath ) {
295
+ if ($ this ->twigDefaultPath && $ this -> projectDir ) {
296
296
$ folders = glob ($ this ->twigDefaultPath .'/bundles/* ' , GLOB_ONLYDIR );
297
297
$ relativePath = ltrim (substr ($ this ->twigDefaultPath .'/bundles ' , \strlen ($ this ->projectDir )), DIRECTORY_SEPARATOR );
298
298
$ bundleNames = array_reduce (
299
299
$ folders ,
300
300
function ($ carry , $ absolutePath ) use ($ relativePath ) {
301
- if (null !== $ this -> projectDir && 0 === strpos ($ absolutePath , $ this ->projectDir )) {
301
+ if (0 === strpos ($ absolutePath , $ this ->projectDir )) {
302
302
$ path = ltrim (substr ($ absolutePath , \strlen ($ this ->projectDir )), DIRECTORY_SEPARATOR );
303
303
$ name = ltrim (substr ($ path , \strlen ($ relativePath )), DIRECTORY_SEPARATOR );
304
304
$ carry [$ name ] = $ path ;
0 commit comments