Skip to content

Commit

Permalink
pint
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Dec 22, 2023
1 parent ae16ba7 commit 3773e27
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/actions/RenderCompiledClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function render(bool $forceRecreate)
file_put_contents($compiledClassPath, $compiledClass);
}

protected function cleanupOldMixins(string $except = null)
protected function cleanupOldMixins(?string $except = null)
{
$compiledClassesPath = __DIR__.'/../storage/';

Expand Down
16 changes: 8 additions & 8 deletions src/behaviors/TestableResponseBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function querySelector(string $selector)
*
* To submit the form use `->submit()` or `->click('.button-selector')`.
*/
public function form(string $selector = null): Form
public function form(?string $selector = null): Form
{
if ($selector === null) {
if ($this->form) {
Expand Down Expand Up @@ -240,7 +240,7 @@ public function assertCacheTag(string ...$tags)
* $response->assertCookie('cookieName', 'cookie value'); // checks that the values match
* ```
*/
public function assertCookie(string $name, string $value = null)
public function assertCookie(string $name, ?string $value = null)
{
if ($value === null) {
Assert::assertContains($name, array_keys($this->response->cookies->toArray()));
Expand Down Expand Up @@ -360,7 +360,7 @@ public function assertDontSeeText(string $text)
* $response->assertDownload('file.jpg'); // checks that a download with the name `file.jpg` is returned
* ```
*/
public function assertDownload(string $filename = null)
public function assertDownload(?string $filename = null)
{
$contentDisposition = explode(';', $this->response->headers->get('content-disposition'));

Expand Down Expand Up @@ -438,7 +438,7 @@ public function assertForbidden()
* $response->assertHeader('x-foo', 'bar'); // checks for header with matching value
* ```
*/
public function assertHeader(string $name, string $expected = null)
public function assertHeader(string $name, ?string $expected = null)
{
if ($expected === null) {
Assert::assertContains($name, array_keys($this->response->headers->toArray()));
Expand Down Expand Up @@ -488,7 +488,7 @@ public function assertJson(array|callable $value, $strict = false)
return $this->response;
}

public function assertJsonCount(int $count, string $key = null)
public function assertJsonCount(int $count, ?string $key = null)
{
$this->getJsonContent()->assertCount($count, $key);

Expand Down Expand Up @@ -535,7 +535,7 @@ public function assertJsonMissingPath(string $path)
return $this->response;
}

public function assertJsonStructure(array $structure = null, $responseData = null)
public function assertJsonStructure(?array $structure = null, $responseData = null)
{
$this->getJsonContent()->assertStructure($structure, $responseData);

Expand Down Expand Up @@ -564,7 +564,7 @@ public function assertJsonValidationErrors()
* $response->assertLocation('/foo', ['host', 'path']);
* ```
*/
public function assertLocation(string $location, array $checkParts = null)
public function assertLocation(string $location, ?array $checkParts = null)
{
$header = $this->response->getHeaders()->get('Location');
$headerParts = parse_url($header);
Expand Down Expand Up @@ -612,7 +612,7 @@ public function assertLocationPath(string $uri)
* $response->assertFlash('Field is required', 'title');
* ```
*/
public function assertFlash(string $message = null, string $key = null)
public function assertFlash(?string $message = null, ?string $key = null)
{
$flash = \Craft::$app->getSession()->getAllFlashes();

Expand Down
2 changes: 1 addition & 1 deletion src/craft/services/ProjectConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class ProjectConfig extends \markhuot\craftpest\overrides\ProjectConfig
{
public function saveModifiedConfigData(bool $writeExternalConfig = null): void
public function saveModifiedConfigData(?bool $writeExternalConfig = null): void
{
// no-op since we don't ever want to save config data back to the DB in a test
}
Expand Down
4 changes: 2 additions & 2 deletions src/http/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class RequestBuilder
public function __construct(
string $method,
string $uri,
\craft\web\Application $app = null,
RequestHandler $handler = null,
?\craft\web\Application $app = null,
?RequestHandler $handler = null,
) {
$this->method = $method;
$this->app = $app ?? \Craft::$app;
Expand Down
2 changes: 1 addition & 1 deletion src/http/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RequestHandler
{
private \craft\web\Application $app;

public function __construct(\craft\web\Application $app = null)
public function __construct(?\craft\web\Application $app = null)
{
$this->app = $app ?? \Craft::$app;
}
Expand Down
2 changes: 1 addition & 1 deletion src/illuminate/AssertableJsonString.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function assertPath($path, $expect)
* @param array|null $responseData
* @return $this
*/
public function assertStructure(array $structure = null, $responseData = null)
public function assertStructure(?array $structure = null, $responseData = null)
{
if (is_null($structure)) {
return $this->assertSimilar($this->decoded);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ActingAs.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait ActingAs
* 4. A callable that returns a User element, `->actingAs(fn () => $someUser)`
* 5. `null` to log the user out for the given request
*/
public function actingAs(UserFactory|User|string|callable $userOrName = null): self
public function actingAs(UserFactory|User|string|callable|null $userOrName = null): self
{
if (is_null($userOrName)) {
\Craft::$app->getUser()->logout(false);
Expand Down

0 comments on commit 3773e27

Please sign in to comment.