Skip to content

Commit

Permalink
Fixed exception texts
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMystikJonas committed Nov 13, 2023
1 parent 58a11fa commit 9e23ebf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Nette/PresenterResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function getPresenterFactory(): IPresenterFactory
} else {
throw new PresenterResolvingNotAvailableException(
'Cannot resolve presenter, no mapping is defined.' .
' Please provide explicit mappings in parameters.nette.applicationMapping or use parameters.nette.containerLoader to load it automatically.'
' Please provide explicit mappings in parameters.netteLinks.applicationMapping or use parameters.netteLinks.containerLoader to load it automatically.'
);
}
$this->presenterFactory = $presenterFactory;
Expand All @@ -82,13 +82,13 @@ protected function getCurrentMapping(): array
foreach ($this->mapping as $module => $mask) {
if (is_string($mask)) {
if (preg_match('#^\\\\?([\w\\\\]*\\\\)?(\w*\*\w*?\\\\)?([\w\\\\]*\*\w*)$#D', $mask, $m) !== 1) {
throw new ShouldNotHappenException(sprintf("Invalid mapping mask '%s' in parameters.nette.applicationMapping.", $mask));
throw new ShouldNotHappenException(sprintf("Invalid mapping mask '%s' in parameters.netteLinks.applicationMapping.", $mask));
}
$convertedMapping[$module] = [$m[1], $m[2] !== '' ? $m[2] : '*Module\\', $m[3]];
} elseif (is_array($mask) && count($mask) === 3) { /** @phpstan-ignore-line */
$convertedMapping[$module] = [$mask[0] !== '' ? $mask[0] . '\\' : '', $mask[1] . '\\', $mask[2]];
} else {
throw new PresenterResolvingException(sprintf('Invalid mapping mask for module %s in parameters.nette.applicationMapping.', $module));
throw new PresenterResolvingException(sprintf('Invalid mapping mask for module %s in parameters.netteLinks.applicationMapping.', $module));
}
}
return $convertedMapping;
Expand Down Expand Up @@ -159,7 +159,7 @@ protected function extractMappingFromPresenterFactory(object $presenterFactory)
if (!$presenterFactory instanceof PresenterFactory) {
throw new PresenterResolvingException(
'PresenterFactory in your container is not instance of Nette\Application\PresenterFactory. We cannot get mapping from it.' .
' Either set your mappings explicitly in parameters.nette.applicationMapping ' .
' Either set your mappings explicitly in parameters.netteLinks.applicationMapping ' .
' or replace service nettePresenterResolver with your own override of getPresenterClass() and/or unformatPresenterClass().'
);
}
Expand Down

0 comments on commit 9e23ebf

Please sign in to comment.