diff --git a/src/Commands/TemplateDiffCommands.php b/src/Commands/TemplateDiffCommands.php
index 6bfa4f0..4a3ff65 100644
--- a/src/Commands/TemplateDiffCommands.php
+++ b/src/Commands/TemplateDiffCommands.php
@@ -72,7 +72,7 @@ class TemplateDiffCommands extends DrushCommands {
    *
    * @command template_diff:show
    */
-  public function commandName(string $template_name, string $location_1 = NULL, string $location_2 = NULL) {
+  public function commandName(string $template_name, ?string $location_1 = NULL, ?string $location_2 = NULL) {
     // Add the Twig file extension if it was not included.
     if (strpos($template_name, 'html.twig') === FALSE) {
       $template_name = sprintf('%s.html.twig', $template_name);
diff --git a/src/TemplateLocation.php b/src/TemplateLocation.php
index dc3db05..be6e9dd 100644
--- a/src/TemplateLocation.php
+++ b/src/TemplateLocation.php
@@ -75,7 +75,7 @@ class TemplateLocation {
     ThemeManagerInterface $themeManager,
     ModuleHandlerInterface $moduleHandler,
     string $template,
-    string $location = NULL
+    ?string $location = NULL
   ) {
     $this->themeHandler = $themeHandler;
     $this->themeManager = $themeManager;
@@ -111,7 +111,7 @@ class TemplateLocation {
    * @param string|null $location
    *   The location information (theme or module name).
    */
-  public function setLocation(string $location = NULL) {
+  public function setLocation(?string $location = NULL) {
     $this->location = $location;
   }
 
