Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Stub methods returning statically in PHPStan 2 #15083

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 144 additions & 54 deletions packages/actions/.stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,153 @@

namespace Livewire\Features\SupportTesting {

/**
* @template-covariant T of object
*/
class Testable {
public function mountAction(string | array $name, array $arguments = []): static {}

public function unmountAction(): static {}

public function setActionData(array $data): static {}

public function assertActionDataSet(array $data): static {}

public function callAction(string | array $name, array $data = [], array $arguments = []): static {}

public function callMountedAction(array $arguments = []): static {}

public function assertActionExists(string | array $name): static {}

public function assertActionDoesNotExist(string | array $name): static {}

public function assertActionVisible(string | array $name, array $arguments = []): static {}

public function assertActionHidden(string | array $name, array $arguments = []): static {}

public function assertActionEnabled(string | array $name): static {}

public function assertActionDisabled(string | array $name): static {}

public function assertActionHasIcon(string | array $name, string $icon): static {}

public function assertActionDoesNotHaveIcon(string | array $name, string $icon): static {}

public function assertActionHasLabel(string | array $name, string $label): static {}

public function assertActionHasColor(string | array $name, string $color): static {}

public function assertActionDoesNotHaveColor(string | array $name, string $color): static {}

public function assertActionHasUrl(string | array $name, string $url): static {}

public function assertActionDoesNotHaveUrl(string | array $name, string $url): static {}

public function assertActionShouldOpenUrlInNewTab(string | array $name): static {}

public function assertActionShouldNotOpenUrlInNewTab(string | array $name): static {}

public function assertActionDoesNotHaveLabel(string | array $name, string $label): static {}

public function assertActionMounted(string | array $name): static {}

public function assertActionNotMounted(string | array $name): static {}

public function assertActionHalted(string | array $name): static {}

public function assertHasActionErrors(array $keys = []): static {}

public function assertHasNoActionErrors(array $keys = []): static {}

/**
* @return T
*/
public function mountAction(string | array $name, array $arguments = []) {}

/**
* @return T
*/
public function unmountAction() {}

/**
* @return T
*/
public function setActionData(array $data) {}

/**
* @return T
*/
public function assertActionDataSet(array $data) {}

/**
* @return T
*/
public function callAction(string | array $name, array $data = [], array $arguments = []) {}

/**
* @return T
*/
public function callMountedAction(array $arguments = []) {}

/**
* @return T
*/
public function assertActionExists(string | array $name) {}

/**
* @return T
*/
public function assertActionDoesNotExist(string | array $name) {}

/**
* @return T
*/
public function assertActionVisible(string | array $name, array $arguments = []) {}

/**
* @return T
*/
public function assertActionHidden(string | array $name, array $arguments = []) {}

/**
* @return T
*/
public function assertActionEnabled(string | array $name) {}

/**
* @return T
*/
public function assertActionDisabled(string | array $name) {}

/**
* @return T
*/
public function assertActionHasIcon(string | array $name, string $icon) {}

/**
* @return T
*/
public function assertActionDoesNotHaveIcon(string | array $name, string $icon) {}

/**
* @return T
*/
public function assertActionHasLabel(string | array $name, string $label) {}

/**
* @return T
*/
public function assertActionHasColor(string | array $name, string $color) {}

/**
* @return T
*/
public function assertActionDoesNotHaveColor(string | array $name, string $color) {}

/**
* @return T
*/
public function assertActionHasUrl(string | array $name, string $url) {}

/**
* @return T
*/
public function assertActionDoesNotHaveUrl(string | array $name, string $url) {}

/**
* @return T
*/
public function assertActionShouldOpenUrlInNewTab(string | array $name) {}

/**
* @return T
*/
public function assertActionShouldNotOpenUrlInNewTab(string | array $name) {}

/**
* @return T
*/
public function assertActionDoesNotHaveLabel(string | array $name, string $label) {}

/**
* @return T
*/
public function assertActionMounted(string | array $name) {}

/**
* @return T
*/
public function assertActionNotMounted(string | array $name) {}

/**
* @return T
*/
public function assertActionHalted(string | array $name) {}

/**
* @return T
*/
public function assertHasActionErrors(array $keys = []) {}

/**
* @return T
*/
public function assertHasNoActionErrors(array $keys = []) {}

/**
* @return T
*/
public function parseActionName(string | array $name): string {}

/**
* @return T
*/
public function parseNestedActionName(string | array $name): array {}
}

Expand Down
Loading
Loading