Skip to content

Commit

Permalink
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_…
Browse files Browse the repository at this point in the history
…null_value
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
1 parent 5d18d8d commit adf3746
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Block/SlackActionsBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct()
/**
* @return $this
*/
public function button(string $text, string $url, string $style = null): self
public function button(string $text, string $url, ?string $style = null): self
{
if (25 === \count($this->options['elements'] ?? [])) {
throw new \LogicException('Maximum number of buttons should not exceed 25.');
Expand Down
2 changes: 1 addition & 1 deletion SlackTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class SlackTransport extends AbstractTransport
private $accessToken;
private $chatChannel;

public function __construct(string $accessToken, string $channel = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
public function __construct(string $accessToken, ?string $channel = null, ?HttpClientInterface $client = null, ?EventDispatcherInterface $dispatcher = null)
{
if (!preg_match('/^xox(b-|p-|a-2)/', $accessToken)) {
throw new InvalidArgumentException('A valid Slack token needs to start with "xoxb-", "xoxp-" or "xoxa-2". See https://api.slack.com/authentication/token-types for further information.');
Expand Down
2 changes: 1 addition & 1 deletion Tests/SlackOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class SlackOptionsTest extends TestCase
* @dataProvider toArrayProvider
* @dataProvider toArraySimpleOptionsProvider
*/
public function testToArray(array $options, array $expected = null)
public function testToArray(array $options, ?array $expected = null)
{
$this->assertSame($expected ?? $options, (new SlackOptions($options))->toArray());
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/SlackTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class SlackTransportTest extends TransportTestCase
/**
* @return SlackTransport
*/
public static function createTransport(HttpClientInterface $client = null, string $channel = null): TransportInterface
public static function createTransport(?HttpClientInterface $client = null, ?string $channel = null): TransportInterface
{
return new SlackTransport('xoxb-TestToken', $channel, $client ?? new MockHttpClient());
}
Expand Down

0 comments on commit adf3746

Please sign in to comment.