shalvah 2 years ago
parent
commit
c51adf3f82
3 changed files with 10 additions and 2 deletions
  1. 4 0
      CHANGELOG.md
  2. 5 1
      src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php
  3. 1 1
      src/Scribe.php

+ 4 - 0
CHANGELOG.md

@@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 
 ### Removed
 
+# 4.6.1 (25 November 2022)
+## Fixed
+- Fix content overflow (closes #567) ([1fad3eb0](https://github.com/knuckleswtf/scribe/commit/1fad3eb021e3fd763485e5cf4c9d9ce495e9dd4a))
+
 # 4.6.0 (18 November 2022)
 ## Modified
 - Styling improvements for the default theme; also show example with parameter description. ([e9bd84fb](https://github.com/knuckleswtf/scribe/commit/e9bd84fb7d1ad3330506ff045380a362bfaa4d99))

+ 5 - 1
src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php

@@ -217,7 +217,11 @@ class GetFromLaravelAPI extends Strategy
         if (class_exists($class = "{$rootNamespace}Models\\" . $className)
             // For the heathens that don't use a Models\ directory
             || class_exists($class = $rootNamespace . $className)) {
-            $instance = new $class;
+            try {
+                $instance = new $class;
+            } catch (\Error) { // It might be an enum or some other non-instantiable class
+                return null;
+            }
             return $instance instanceof Model ? $instance : null;
         }
 

+ 1 - 1
src/Scribe.php

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