Skip to content

Commit

Permalink
Refactored Chunk Method using Null Coalescing Operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kitamatsu-rui committed Dec 11, 2023
1 parent 4fe214d commit 944440c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Foundation/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,7 @@ public function manifestHash($buildDirectory = null)
*/
protected function chunk($manifest, $file)
{
if (! isset($manifest[$file])) {
throw new Exception("Unable to locate file in Vite manifest: {$file}.");
}

return $manifest[$file];
return $manifest[$file] ?? throw new Exception("Unable to locate file in Vite manifest: {$file}.");
}

/**
Expand Down

0 comments on commit 944440c

Please sign in to comment.