From 72902cbba9d10303cf2580cb4e96107317734fc0 Mon Sep 17 00:00:00 2001 From: shalvah Date: Fri, 22 May 2020 18:50:08 +0100 Subject: [PATCH] Add GetFromHeaderTag strategy in the default config --- config/scribe.php | 1 + docs/config.md | 1 + docs/plugins.md | 1 + src/Extracting/Generator.php | 1 + tests/Unit/GeneratorTestCase.php | 1 + 5 files changed, 5 insertions(+) diff --git a/config/scribe.php b/config/scribe.php index 9350ce3d..64292fe4 100644 --- a/config/scribe.php +++ b/config/scribe.php @@ -301,6 +301,7 @@ ], 'headers' => [ \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules::class, + \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromHeaderTag::class, ], 'bodyParameters' => [ \Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest::class, diff --git a/docs/config.md b/docs/config.md index e81d44cb..789852e2 100644 --- a/docs/config.md +++ b/docs/config.md @@ -107,6 +107,7 @@ A nested array of strategies Scribe will use to extract information about your r ], 'headers' => [ \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules::class, + \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromHeaderTag::class, ], 'bodyParameters' => [ \Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest::class, diff --git a/docs/plugins.md b/docs/plugins.md index 1fee31c4..316d0fa7 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -33,6 +33,7 @@ There are a number of strategies included with the package, so you don't have to ], 'headers' => [ \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules::class, + \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromHeaderTag::class, ], 'bodyParameters' => [ \Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest::class, diff --git a/src/Extracting/Generator.php b/src/Extracting/Generator.php index bc2fd640..1367300a 100644 --- a/src/Extracting/Generator.php +++ b/src/Extracting/Generator.php @@ -174,6 +174,7 @@ protected function iterateThroughStrategies(string $stage, array $extractedData, ], 'headers' => [ \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules::class, + \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromHeaderTag::class, ], 'bodyParameters' => [ \Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest::class, diff --git a/tests/Unit/GeneratorTestCase.php b/tests/Unit/GeneratorTestCase.php index 77bdef3a..1db42de0 100644 --- a/tests/Unit/GeneratorTestCase.php +++ b/tests/Unit/GeneratorTestCase.php @@ -32,6 +32,7 @@ abstract class GeneratorTestCase extends TestCase ], 'headers' => [ \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules::class, + \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromHeaderTag::class, ], 'bodyParameters' => [ \Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromBodyParamTag::class,