update after stop build
All checks were successful
All checks were successful
This commit is contained in:
30
vendor/knuckleswtf/scribe/src/Extracting/Strategies/StaticData.php
vendored
Normal file
30
vendor/knuckleswtf/scribe/src/Extracting/Strategies/StaticData.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Knuckles\Scribe\Extracting\Strategies;
|
||||
|
||||
use Knuckles\Camel\Extraction\ExtractedEndpointData;
|
||||
|
||||
/**
|
||||
* A simple strategy that returns a set of static data.
|
||||
*/
|
||||
class StaticData extends Strategy
|
||||
{
|
||||
public function __invoke(ExtractedEndpointData $endpointData, array $settings = []): ?array
|
||||
{
|
||||
return $settings['data'];
|
||||
}
|
||||
|
||||
public static function withSettings(
|
||||
array $only = [],
|
||||
array $except = [],
|
||||
array $data = [],
|
||||
): array {
|
||||
return static::wrapWithSettings(
|
||||
only: $only,
|
||||
except: $except,
|
||||
otherSettings: compact(
|
||||
'data',
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user