Compare commits

...

2 Commits

Author SHA1 Message Date
philipp lang a9ecdfe4bb Lint
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/tag Build is failing Details
2024-07-08 23:17:14 +02:00
philipp lang 10a966c6ad Lint 2024-07-08 23:06:45 +02:00
10 changed files with 38 additions and 65 deletions

View File

@ -155,8 +155,9 @@ class AddressBookBackend extends AbstractBackend
* If the backend supports this, it may allow for some speed-ups. * If the backend supports this, it may allow for some speed-ups.
* *
* @param mixed $addressBookId * @param mixed $addressBookId
* @param array<int, string> $uris
* *
* @return array * @return array<int, mixed>
*/ */
public function getMultipleCards($addressBookId, array $uris) public function getMultipleCards($addressBookId, array $uris)
{ {

View File

@ -136,10 +136,11 @@ class Principal implements PrincipalBackendInterface
* *
* @param string $principal * @param string $principal
* *
* @return array * @return array<int, string>|null
*/ */
public function getGroupMemberSet($principal) public function getGroupMemberSet($principal)
{ {
return [];
} }
/** /**
@ -147,7 +148,7 @@ class Principal implements PrincipalBackendInterface
* *
* @param string $principal * @param string $principal
* *
* @return array * @return array<int, string>|null
*/ */
public function getGroupMembership($principal) public function getGroupMembership($principal)
{ {
@ -155,7 +156,7 @@ class Principal implements PrincipalBackendInterface
return null; return null;
} }
return ['addressbooks/'.$matches[1]]; return ['addressbooks/' . $matches[1]];
} }
/** /**
@ -164,6 +165,8 @@ class Principal implements PrincipalBackendInterface
* The principals should be passed as a list of uri's. * The principals should be passed as a list of uri's.
* *
* @param string $principal * @param string $principal
* @param array<int, string> $members
* @return void
*/ */
public function setGroupMemberSet($principal, array $members) public function setGroupMemberSet($principal, array $members)
{ {
@ -176,7 +179,7 @@ class Principal implements PrincipalBackendInterface
{ {
return [ return [
'{DAV:}displayname' => $user->name, '{DAV:}displayname' => $user->name,
'uri' => 'principals/'.$user->email, 'uri' => 'principals/' . $user->email,
'{http://sabredav.org/ns}email-address' => $user->email, '{http://sabredav.org/ns}email-address' => $user->email,
]; ];
} }

View File

@ -9,6 +9,7 @@ use Sabre\CardDAV\AddressBookRoot;
use Sabre\CardDAV\Plugin as CardDAVPlugin; use Sabre\CardDAV\Plugin as CardDAVPlugin;
use Sabre\DAV\Auth\Plugin as AuthPlugin; use Sabre\DAV\Auth\Plugin as AuthPlugin;
use Sabre\DAV\Browser\Plugin as BrowserPlugin; use Sabre\DAV\Browser\Plugin as BrowserPlugin;
use Sabre\DAV\ServerPlugin;
use Sabre\DAVACL\AbstractPrincipalCollection; use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\DAVACL\Plugin as AclPlugin; use Sabre\DAVACL\Plugin as AclPlugin;
use Sabre\DAVACL\PrincipalCollection; use Sabre\DAVACL\PrincipalCollection;
@ -50,6 +51,9 @@ class ServiceProvider extends BaseServiceProvider
]; ];
} }
/**
* @return array<int, ServerPlugin>
*/
private function plugins(): array private function plugins(): array
{ {
$authBackend = new AuthBackend(); $authBackend = new AuthBackend();

View File

@ -12,15 +12,14 @@ class Handler extends ExceptionHandler
/** /**
* A list of the exception types that are not reported. * A list of the exception types that are not reported.
* *
* @var string[] * @var array<int, class-string<Throwable>>
*/ */
protected $dontReport = [ protected $dontReport = [];
];
/** /**
* A list of the inputs that are never flashed for validation exceptions. * A list of the inputs that are never flashed for validation exceptions.
* *
* @var string[] * @var array<int, string>
*/ */
protected $dontFlash = [ protected $dontFlash = [
'password', 'password',

View File

@ -8,6 +8,7 @@ use Spatie\LaravelData\Data;
class EditorData extends Data implements Editorable class EditorData extends Data implements Editorable
{ {
/** @param array<int, mixed> $blocks */
public function __construct( public function __construct(
public string $version, public string $version,
public array $blocks, public array $blocks,
@ -47,6 +48,9 @@ class EditorData extends Data implements Editorable
return $this; return $this;
} }
/**
* @param array<int, string> $replacements
*/
public function replaceWithList(string $blockContent, array $replacements): self public function replaceWithList(string $blockContent, array $replacements): self
{ {
$this->blocks = collect($this->blocks)->map(function ($block) use ($blockContent, $replacements) { $this->blocks = collect($this->blocks)->map(function ($block) use ($blockContent, $replacements) {

View File

@ -12,6 +12,9 @@ class SettingStoreAction
{ {
use AsAction; use AsAction;
/**
* @return array<string, string>
*/
public function rules(): array public function rules(): array
{ {
return [ return [

View File

@ -6,6 +6,7 @@ parameters:
stubFiles: stubFiles:
- tests/stub/phpstan/TestResponse.stub - tests/stub/phpstan/TestResponse.stub
- tests/stub/phpstan/Settings.stub
paths: paths:
- app - app
@ -33,61 +34,6 @@ parameters:
count: 1 count: 1
path: app/Activity.php path: app/Activity.php
-
message: "#^Method App\\\\Dav\\\\AddressBookBackend\\:\\:getMultipleCards\\(\\) has parameter \\$uris with no value type specified in iterable type array\\.$#"
count: 1
path: app/Dav/AddressBookBackend.php
-
message: "#^Method App\\\\Dav\\\\AddressBookBackend\\:\\:getMultipleCards\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: app/Dav/AddressBookBackend.php
-
message: "#^Method App\\\\Dav\\\\Principal\\:\\:getGroupMemberSet\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: app/Dav/Principal.php
-
message: "#^Method App\\\\Dav\\\\Principal\\:\\:getGroupMemberSet\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: app/Dav/Principal.php
-
message: "#^Method App\\\\Dav\\\\Principal\\:\\:getGroupMembership\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: app/Dav/Principal.php
-
message: "#^Method App\\\\Dav\\\\Principal\\:\\:getGroupMembership\\(\\) should return array but returns null\\.$#"
count: 1
path: app/Dav/Principal.php
-
message: "#^Method App\\\\Dav\\\\Principal\\:\\:setGroupMemberSet\\(\\) has no return type specified\\.$#"
count: 1
path: app/Dav/Principal.php
-
message: "#^Method App\\\\Dav\\\\Principal\\:\\:setGroupMemberSet\\(\\) has parameter \\$members with no value type specified in iterable type array\\.$#"
count: 1
path: app/Dav/Principal.php
-
message: "#^Method App\\\\Dav\\\\ServiceProvider\\:\\:plugins\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: app/Dav/ServiceProvider.php
-
message: "#^PHPDoc type array\\<string\\> of property App\\\\Exceptions\\\\Handler\\:\\:\\$dontFlash is not covariant with PHPDoc type array\\<int, string\\> of overridden property Illuminate\\\\Foundation\\\\Exceptions\\\\Handler\\:\\:\\$dontFlash\\.$#"
count: 1
path: app/Exceptions/Handler.php
-
message: "#^PHPDoc type array\\<string\\> of property App\\\\Exceptions\\\\Handler\\:\\:\\$dontReport is not covariant with PHPDoc type array\\<int, class\\-string\\<Throwable\\>\\> of overridden property Illuminate\\\\Foundation\\\\Exceptions\\\\Handler\\:\\:\\$dontReport\\.$#"
count: 1
path: app/Exceptions/Handler.php
- -
message: "#^Method App\\\\Http\\\\Controllers\\\\Auth\\\\RegisterController\\:\\:create\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" message: "#^Method App\\\\Http\\\\Controllers\\\\Auth\\\\RegisterController\\:\\:create\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
count: 1 count: 1

View File

@ -21,6 +21,7 @@ use Worksome\RequestFactories\RequestFactory;
* @method self isActive(bool $isActive) * @method self isActive(bool $isActive)
* @method self isPrivate(bool $isPrivate) * @method self isPrivate(bool $isPrivate)
* @method self export(ExportData $export) * @method self export(ExportData $export)
* @method self preventionText(EditorRequestFactory $text)
*/ */
class FormRequest extends RequestFactory class FormRequest extends RequestFactory
{ {

View File

@ -131,7 +131,7 @@ class FormUpdateActionTest extends FormTestCase
$this->login()->loginNami()->withoutExceptionHandling(); $this->login()->loginNami()->withoutExceptionHandling();
$form = Form::factory()->create(); $form = Form::factory()->create();
$payload = FormRequest::new() $payload = FormRequest::new()
->preventionText(EditorRequestFactory::new()->text(10, 'lorem ipsum')->create()) ->preventionText(EditorRequestFactory::new()->text(10, 'lorem ipsum'))
->state(['needs_prevention' => true]) ->state(['needs_prevention' => true])
->create(); ->create();

View File

@ -0,0 +1,12 @@
<?php
namespace Illuminate\Testing;
namespace Spatie\LaravelSettings;
/**
* @method static refresh()
*/
abstract class Settings
{
}