original_string: protected function getDirOption($return_array = false)
      {
          if($dir = $this->option('dir')) {
              $directories = explode('/', $dir);
              if(is_array($directories) && $directories) {
                  $directories = array_map(function($directory) {
                      return ucfirst(str::plural(strtolower($directory)));
                  }, $directories);
  
                  return $return_array === true ? $directories : rtrim(implode('/', $directories), '/\\') . '/';
              }
          }
      }
code: protected function getDirOption($return_array = false)
      {
          if($dir = $this->option('dir')) {
              $directories = explode('/', $dir);
              if(is_array($directories) && $directories) {
                  $directories = array_map(function($directory) {
                      return ucfirst(str::plural(strtolower($directory)));
                  }, $directories);
  
                  return $return_array === true ? $directories : rtrim(implode('/', $directories), '/\\') . '/';
              }
          }
      }
code_tokens: protected function getDirOption ( $ return_array = false ) { if ( $ dir = $ this -> option ( 'dir' ) ) { $ directories = explode ( '/' , $ dir ) ; if ( is_array ( $ directories ) && $ directories ) { $ directories = array_map ( function ( $ directory ) { return ucfirst ( str :: plural ( strtolower ( $ directory ) ) ) ; } , $ directories ) ; return $ return_array === true ? $ directories : rtrim ( implode ( '/' , $ directories ) , '/\\' ) . '/' ; } } }
docstring: Return the directory option
  
  @return string|null
docstring_tokens: Return the directory option