Skip to content

Commit cd5a555

Browse files
committed
chore: strict types
1 parent a9bb6d3 commit cd5a555

22 files changed

+66
-24
lines changed

src/Api/Illustration.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Api;
46

57
use Illuminate\Support\Str;
68

7-
class Illustration
9+
final class Illustration
810
{
911
/**
1012
* @var string

src/Api/IllustrationRequest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Api;
46

57
use GuzzleHttp\ClientInterface;
68
use Psr\Http\Message\ResponseInterface;
79

8-
class IllustrationRequest
10+
final class IllustrationRequest
911
{
1012
/**
1113
* @var ClientInterface

src/Api/IllustrationResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Api;
46

57
use Psr\Http\Message\ResponseInterface;
68

7-
class IllustrationResponse
9+
final class IllustrationResponse
810
{
911
/**
1012
* @var ResponseInterface

src/Api/IllustrationsRequest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Api;
46

57
use GuzzleHttp\ClientInterface;
68
use Psr\Http\Message\ResponseInterface;
79

8-
class IllustrationsRequest
10+
final class IllustrationsRequest
911
{
1012
/**
1113
* @var ClientInterface

src/Api/IllustrationsResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Api;
46

57
use Psr\Http\Message\ResponseInterface;
68

7-
class IllustrationsResponse
9+
final class IllustrationsResponse
810
{
911

1012
/**

src/Api/UndrawClient.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Api;
46

57
use GuzzleHttp\Client;
68

7-
class UndrawClient extends Client
9+
final class UndrawClient extends Client
810
{
911
public function __construct()
1012
{

src/Components/BaseComponent.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Components;
46

57
use Illuminate\Support\Facades\View;
68
use Illuminate\Support\Str;
79
use Illuminate\View\Component;
810

9-
class BaseComponent extends Component
11+
abstract class BaseComponent extends Component
1012
{
1113
/**
1214
* @var string
@@ -21,7 +23,7 @@ public function __construct(string $color = '#6C63FF')
2123
protected function illustrationName(): string
2224
{
2325
$calledComponent = Str::afterLast(get_called_class(), '\\');
24-
$illustration = str_replace(['Undraw', 'Component'], null, $calledComponent);
26+
$illustration = str_replace(['Undraw', 'Component'], '', $calledComponent);
2527

2628
return Str::snake($illustration);
2729
}

src/Components/UndrawComponent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace BladeComponents\Undraw\Components;
44

5-
class UndrawComponent extends BaseComponent
5+
final class UndrawComponent extends BaseComponent
66
{
77
/**
88
* @var string

stubs/DummyIllustrationComponent.stub

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Components\Illustrations;
46

57
use BladeComponents\Undraw\Components\BaseComponent;
68

7-
class DummyIllustrationComponent extends BaseComponent
9+
final class DummyIllustrationComponent extends BaseComponent
810
{
911
}

stubs/UndrawServiceProvider.stub

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Providers;
46

57
use BladeComponents\Undraw\Components\UndrawComponent;
68
use Illuminate\Support\Facades\Blade;
79
use Illuminate\Support\ServiceProvider;
810

9-
class UndrawServiceProvider extends ServiceProvider
11+
final class UndrawServiceProvider extends ServiceProvider
1012
{
1113
public function boot(): void
1214
{

tests/Api/IllustrationRequestTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Api;
46

57
use BladeComponents\Undraw\Api\IllustrationRequest;
@@ -10,7 +12,7 @@
1012
use GuzzleHttp\Psr7\Response;
1113
use Psr\Http\Message\ResponseInterface;
1214

13-
class IllustrationRequestTest extends TestCase
15+
final class IllustrationRequestTest extends TestCase
1416
{
1517
/** @test */
1618
public function it_should_return_an_illustration_response_correctly(): void

tests/Api/IllustrationResponseTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Api;
46

57
use BladeComponents\Undraw\Api\IllustrationResponse;
68
use BladeComponents\Undraw\Tests\TestCase;
79
use GuzzleHttp\Psr7\Response;
810

9-
class IllustrationResponseTest extends TestCase
11+
final class IllustrationResponseTest extends TestCase
1012
{
1113
/** @test */
1214
public function it_should_receive_the_response_content_correctly(): void

tests/Api/IllustrationTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Api;
46

57
use BladeComponents\Undraw\Api\Illustration;
68
use BladeComponents\Undraw\Tests\TestCase;
79

8-
class IllustrationTest extends TestCase
10+
final class IllustrationTest extends TestCase
911
{
1012
/**
1113
* @test

tests/Api/IllustrationsRequestTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Api;
46

57
use BladeComponents\Undraw\Api\IllustrationRequest;
@@ -11,7 +13,7 @@
1113
use GuzzleHttp\Psr7\Response;
1214
use Psr\Http\Message\ResponseInterface;
1315

14-
class IllustrationsRequestTest extends TestCase
16+
final class IllustrationsRequestTest extends TestCase
1517
{
1618
/** @test */
1719
public function it_should_return_a_page_correctly(): void

tests/Api/IllustrationsResponseTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Api;
46

57
use BladeComponents\Undraw\Api\Illustration;
68
use BladeComponents\Undraw\Api\IllustrationsResponse;
79
use BladeComponents\Undraw\Tests\TestCase;
810
use GuzzleHttp\Psr7\Response;
911

10-
class IllustrationsResponseTest extends TestCase
12+
final class IllustrationsResponseTest extends TestCase
1113
{
1214
/** @test */
1315
public function it_should_return_the_next_page_correctly(): void

tests/Api/UndrawClientTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Api;
46

57
use BladeComponents\Undraw\Api\UndrawClient;
68
use BladeComponents\Undraw\Tests\TestCase;
79
use GuzzleHttp\Psr7\Uri;
810

9-
class UndrawClientTest extends TestCase
11+
final class UndrawClientTest extends TestCase
1012
{
1113
/** @test */
1214
public function it_should_set_the_base_uri_correctly(): void

tests/Components/BaseComponentTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Components;
46

57
use BladeComponents\Undraw\Components\UndrawComponent;
68
use BladeComponents\Undraw\Tests\TestCase;
79

8-
class BaseComponentTest extends TestCase
10+
final class BaseComponentTest extends TestCase
911
{
1012
/** @test */
1113
public function it_has_a_color_by_default(): void

tests/Components/DummyIllustrationComponent.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Components;
46

57
use BladeComponents\Undraw\Components\BaseComponent;
68

7-
class DummyIllustrationComponent extends BaseComponent
9+
final class DummyIllustrationComponent extends BaseComponent
810
{
911
public function illustrationName(): string
1012
{

tests/Components/Illustrations/Undraw3dModelingComponentTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Components\Illustrations;
46

57
use BladeComponents\Undraw\Components\Illustrations\Undraw3dModelingComponent;
68
use BladeComponents\Undraw\Tests\TestCase;
79

8-
class Undraw3dModelingComponentTest extends TestCase
10+
final class Undraw3dModelingComponentTest extends TestCase
911
{
1012
/** @test */
1113
public function it_has_a_color_by_default(): void

tests/Components/Illustrations/UndrawAbstractComponentTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Components\Illustrations;
46

57
use BladeComponents\Undraw\Components\Illustrations\UndrawAbstractComponent;
68
use BladeComponents\Undraw\Tests\TestCase;
79

8-
class UndrawAbstractComponentTest extends TestCase
10+
final class UndrawAbstractComponentTest extends TestCase
911
{
1012
/** @test */
1113
public function it_has_a_color_by_default(): void

tests/Components/Illustrations/UndrawBuildYourHomeComponentTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests\Components\Illustrations;
46

57
use BladeComponents\Undraw\Components\Illustrations\UndrawBuildYourHomeComponent;
68
use BladeComponents\Undraw\Tests\TestCase;
79

8-
class UndrawBuildYourHomeComponentTest extends TestCase
10+
final class UndrawBuildYourHomeComponentTest extends TestCase
911
{
1012
/** @test */
1113
public function it_has_a_color_by_default(): void

tests/TestCase.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace BladeComponents\Undraw\Tests;
46

57
use BladeComponents\Undraw\Providers\UndrawServiceProvider;
68
use Orchestra\Testbench\TestCase as BaseTestCase;
79

8-
class TestCase extends BaseTestCase
10+
abstract class TestCase extends BaseTestCase
911
{
10-
protected function getPackageProviders($app)
12+
protected function getPackageProviders($app): array
1113
{
1214
return [
1315
UndrawServiceProvider::class,

0 commit comments

Comments
 (0)