shalvah hace 2 años
padre
commit
fca55860d8
Se han modificado 3 ficheros con 10 adiciones y 2 borrados
  1. 6 0
      CHANGELOG.md
  2. 1 1
      src/Scribe.php
  3. 3 1
      src/Writing/HtmlWriter.php

+ 6 - 0
CHANGELOG.md

@@ -12,6 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 
 ### Removed
 
+# 4.1.0 (15 October 2022)
+### Added
+- Set bearer token properly in Postman Collection ([#529](https://github.com/knuckleswtf/scribe/pull/529/))
+- Customizable "Last updated at" label ([44996fe](https://github.com/knuckleswtf/scribe/commit/529/44996fe6f09b42648da19df97dd444d1aac8b003))
+- Turn subgroups into folders in Postman collection ([3152793](https://github.com/knuckleswtf/scribe/commit/529/3152793064afdf26a5de2c310bac73acc6581c48))
+
 # 4.0.0 (10 September 2022)
 ### Removed
 - [Breaking Change] Sorting groups or endpoints via editing/renaming the Camel files is no longer supported. Use the `groups.order` config item instead. 

+ 1 - 1
src/Scribe.php

@@ -8,7 +8,7 @@ use Symfony\Component\HttpFoundation\Request;
 
 class Scribe
 {
-    public const VERSION = '4.0.0';
+    public const VERSION = '4.1.0';
 
     /**
      * Specify a callback that will be executed just before a response call is made

+ 3 - 1
src/Writing/HtmlWriter.php

@@ -2,6 +2,7 @@
 
 namespace Knuckles\Scribe\Writing;
 
+use http\Exception\InvalidArgumentException;
 use Illuminate\Support\Facades\View;
 use Illuminate\Support\Str;
 use Knuckles\Camel\Output\OutputEndpointData;
@@ -145,9 +146,10 @@ class HtmlWriter
 
         $tokens = [
             "date" => fn($format) => date($format),
-            "git" => fn($option) => match ($option) {
+            "git" => fn($format) => match ($format) {
                 "short" => trim(shell_exec('git rev-parse --short HEAD')),
                 "long" => trim(shell_exec('git rev-parse HEAD')),
+                default => throw new InvalidArgumentException("The `git` token only supports formats 'short' and 'long', but you specified $format"),
             },
         ];