diff --git a/app/Lib/Editor/EditorData.php b/app/Lib/Editor/EditorData.php index f395a50c..debffc23 100644 --- a/app/Lib/Editor/EditorData.php +++ b/app/Lib/Editor/EditorData.php @@ -8,6 +8,7 @@ use Spatie\LaravelData\Data; class EditorData extends Data implements Editorable { + /** @param array $blocks */ public function __construct( public string $version, public array $blocks, @@ -47,6 +48,9 @@ class EditorData extends Data implements Editorable return $this; } + /** + * @param array $replacements + */ public function replaceWithList(string $blockContent, array $replacements): self { $this->blocks = collect($this->blocks)->map(function ($block) use ($blockContent, $replacements) { diff --git a/app/Prevention/Actions/SettingStoreAction.php b/app/Prevention/Actions/SettingStoreAction.php index 57263463..cf72952c 100644 --- a/app/Prevention/Actions/SettingStoreAction.php +++ b/app/Prevention/Actions/SettingStoreAction.php @@ -12,6 +12,9 @@ class SettingStoreAction { use AsAction; + /** + * @return array + */ public function rules(): array { return [ diff --git a/phpstan.neon b/phpstan.neon index 13723265..62723251 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,6 +6,7 @@ parameters: stubFiles: - tests/stub/phpstan/TestResponse.stub + - tests/stub/phpstan/Settings.stub paths: - app diff --git a/tests/Feature/Form/FormRequest.php b/tests/Feature/Form/FormRequest.php index 4a949965..d7a762af 100644 --- a/tests/Feature/Form/FormRequest.php +++ b/tests/Feature/Form/FormRequest.php @@ -21,6 +21,7 @@ use Worksome\RequestFactories\RequestFactory; * @method self isActive(bool $isActive) * @method self isPrivate(bool $isPrivate) * @method self export(ExportData $export) + * @method self preventionText(EditorRequestFactory $text) */ class FormRequest extends RequestFactory { diff --git a/tests/Feature/Form/FormUpdateActionTest.php b/tests/Feature/Form/FormUpdateActionTest.php index 417b588c..ecfd635e 100644 --- a/tests/Feature/Form/FormUpdateActionTest.php +++ b/tests/Feature/Form/FormUpdateActionTest.php @@ -131,7 +131,7 @@ class FormUpdateActionTest extends FormTestCase $this->login()->loginNami()->withoutExceptionHandling(); $form = Form::factory()->create(); $payload = FormRequest::new() - ->preventionText(EditorRequestFactory::new()->text(10, 'lorem ipsum')->create()) + ->preventionText(EditorRequestFactory::new()->text(10, 'lorem ipsum')) ->state(['needs_prevention' => true]) ->create(); diff --git a/tests/stub/phpstan/Settings.stub b/tests/stub/phpstan/Settings.stub new file mode 100644 index 00000000..9f37d013 --- /dev/null +++ b/tests/stub/phpstan/Settings.stub @@ -0,0 +1,12 @@ +