Skip to content

Commit

Permalink
[TASK] Apply AddErrorCodeToExceptionRector
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi committed Nov 26, 2024
1 parent 84e6760 commit 86e9b80
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/NewsBaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function handleNoNewsFoundError(string $configuration): ?ResponseInter
'If error handling "%s" is used, either 2 or 3 arguments, split by "," must be used',
$options[0]
);
throw new \InvalidArgumentException($msg);
throw new \InvalidArgumentException($msg, 7238087293);
}
$this->uriBuilder->reset();
$this->uriBuilder->setTargetPageUid($options[1]);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/NewsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected function createConstraintsFromDemand(QueryInterface $query, DemandInte
// month & year OR year only
if ($demand->getYear() > 0) {
if (!$demand->getDateField()) {
throw new \InvalidArgumentException('No Datefield is set, therefore no Datemenu is possible!');
throw new \InvalidArgumentException('No Datefield is set, therefore no Datemenu is possible!', 4992412221);
}
if ($demand->getMonth() > 0) {
if ($demand->getDay() > 0) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/CategoryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function getChildrenCategories(
$removeGivenIdListFromResult = false
): string {
if ($additionalWhere !== '') {
throw new \UnexpectedValueException('The argument $additionalWhere is not supported anymore');
throw new \UnexpectedValueException('The argument $additionalWhere is not supported anymore', 1025758541);
}
$cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('news_category');
$cacheIdentifier = sha1('children' . $idList);
Expand Down
10 changes: 5 additions & 5 deletions Classes/Utility/ClassCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(?PhpFrontend $classCache = null)
public function reBuildSimple(bool $forceRebuild = false)
{
if (!function_exists('token_get_all')) {
throw new \Exception('The function token_get_all must exist. Please install the module PHP Module Tokenizer');
throw new \Exception('The function token_get_all must exist. Please install the module PHP Module Tokenizer', 4045351298);
}

if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes'])) {
Expand All @@ -61,7 +61,7 @@ public function reBuild()
$classPath = 'Classes/';

if (!function_exists('token_get_all')) {
throw new \Exception('The function token_get_all must exist. Please install the module PHP Module Tokenizer');
throw new \Exception('The function token_get_all must exist. Please install the module PHP Module Tokenizer', 7052287505);
}

if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes'])) {
Expand All @@ -74,7 +74,7 @@ public function reBuild()

$path = ExtensionManagementUtility::extPath('news') . $classPath . $key . '.php';
if (!is_file($path)) {
throw new \Exception('Given file "' . $path . '" does not exist');
throw new \Exception('Given file "' . $path . '" does not exist', 8496960795);
}
$code = $this->parseSingleFile($path, true);

Expand All @@ -99,7 +99,7 @@ public function reBuild()
try {
$this->classCache->set($cacheEntryIdentifier, $code);
} catch (\Exception $e) {
throw new \Exception($e->getMessage());
throw new \Exception($e->getMessage(), 2006286512);
}
}
}
Expand All @@ -119,7 +119,7 @@ public function reBuild()
protected function parseSingleFile($filePath, $baseClass = false): string
{
if (!is_file($filePath)) {
throw new \InvalidArgumentException(sprintf('File "%s" could not be found', $filePath));
throw new \InvalidArgumentException(sprintf('File "%s" could not be found', $filePath), 3594518105);
}
$code = @file_get_contents($filePath);

Expand Down
4 changes: 2 additions & 2 deletions Classes/Utility/ConstraintHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function getTimeRestrictionLow($timeInput): int
if ($timeFromString) {
$timeLimit = $timeFromString;
} else {
throw new Exception('Time limit Low could not be resolved to an integer. Given was: ' . htmlspecialchars($timeLimit));
throw new Exception('Time limit Low could not be resolved to an integer. Given was: ' . htmlspecialchars($timeLimit), 5535166030);
}
}
}
Expand All @@ -67,6 +67,6 @@ public static function getTimeRestrictionHigh($timeInput): int
if ($timeFromStringHigh) {
return $timeFromStringHigh;
}
throw new Exception('Time limit High could not be resolved to an integer. Given was: ' . htmlspecialchars($timeLimit));
throw new Exception('Time limit High could not be resolved to an integer. Given was: ' . htmlspecialchars($timeLimit), 8748470417);
}
}

0 comments on commit 86e9b80

Please sign in to comment.