Skip to content

Commit 6f6646c

Browse files
committed
Fix types
1 parent b7f3723 commit 6f6646c

13 files changed

+24
-72
lines changed

phpstan-bootstrap.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
class_exists(\Hoa\Socket\Connection::class);
64
class_exists(\Hoa\Exception::class);

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
parameters:
22
bootstrapFiles:
33
- phpstan-bootstrap.php
4-
phpVersion: 70200

src/Exercise/ArrayWeGo.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,8 @@ class ArrayWeGo extends AbstractExercise implements ExerciseInterface, FunctionR
1818
{
1919
use TemporaryDirectoryTrait;
2020

21-
/**
22-
* @var Filesystem
23-
*/
24-
private $filesystem;
25-
26-
/**
27-
* @var Generator
28-
*/
29-
private $faker;
21+
private Filesystem $filesystem;
22+
private Generator $faker;
3023

3124
public function __construct(Filesystem $filesystem, Generator $faker)
3225
{

src/Exercise/ConcernedAboutSeparation.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PhpSchool\LearnYouPhp\Exercise;
44

5-
use Faker\Generator;
65
use PhpParser\Node\Stmt\Expression;
76
use PhpParser\Parser;
87
use PhpSchool\PhpWorkshop\Exercise\AbstractExercise;
@@ -11,7 +10,6 @@
1110
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
1211
use PhpSchool\PhpWorkshop\Exercise\TemporaryDirectoryTrait;
1312
use PhpSchool\PhpWorkshop\ExerciseCheck\SelfCheck;
14-
use PhpSchool\PhpWorkshop\ExerciseCheck\StdOutExerciseCheck;
1513
use PhpSchool\PhpWorkshop\Input\Input;
1614
use PhpSchool\PhpWorkshop\Result\Failure;
1715
use PhpSchool\PhpWorkshop\Result\ResultInterface;
@@ -25,15 +23,8 @@ class ConcernedAboutSeparation extends AbstractExercise implements ExerciseInter
2523
{
2624
use TemporaryDirectoryTrait;
2725

28-
/**
29-
* @var Filesystem
30-
*/
31-
private $filesystem;
32-
33-
/**
34-
* @var Parser
35-
*/
36-
private $parser;
26+
private Filesystem $filesystem;
27+
private Parser $parser;
3728

3829
public function __construct(Filesystem $filesystem, Parser $parser)
3930
{

src/Exercise/DatabaseRead.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@
1414
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
1515
use PhpSchool\PhpWorkshop\ExerciseCheck\DatabaseExerciseCheck;
1616
use PhpSchool\PhpWorkshop\ExerciseDispatcher;
17-
use PhpSchool\PhpWorkshop\SubmissionPatch;
1817
use Symfony\Component\Filesystem\Filesystem;
1918

2019
class DatabaseRead extends AbstractExercise implements ExerciseInterface, DatabaseExerciseCheck, CliExercise
2120
{
22-
/**
23-
* @var Generator
24-
*/
25-
private $faker;
21+
private Generator $faker;
2622

2723
/**
2824
* @var array{id: int, name: string}
2925
*/
30-
private $randomRecord;
26+
private array $randomRecord;
3127

3228
public function __construct(Generator $faker)
3329
{

src/Exercise/DependencyHeaven.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ class DependencyHeaven extends AbstractExercise implements
2020
CgiExercise,
2121
ComposerExerciseCheck
2222
{
23-
/**
24-
* @var Generator
25-
*/
26-
private $faker;
23+
private Generator $faker;
2724

2825
public function __construct(Generator $faker)
2926
{

src/Exercise/ExceptionalCoding.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
1111
use PhpSchool\PhpWorkshop\Exercise\TemporaryDirectoryTrait;
1212
use PhpSchool\PhpWorkshop\ExerciseCheck\FunctionRequirementsExerciseCheck;
13-
use PhpSchool\PhpWorkshop\ExerciseCheck\StdOutExerciseCheck;
1413
use PhpSchool\PhpWorkshop\ExerciseDispatcher;
1514
use Symfony\Component\Filesystem\Filesystem;
1615

@@ -21,15 +20,8 @@ class ExceptionalCoding extends AbstractExercise implements
2120
{
2221
use TemporaryDirectoryTrait;
2322

24-
/**
25-
* @var Filesystem
26-
*/
27-
private $filesystem;
28-
29-
/**
30-
* @var Generator
31-
*/
32-
private $faker;
23+
private Filesystem $filesystem;
24+
private Generator $faker;
3325

3426
public function __construct(Filesystem $filesystem, Generator $faker)
3527
{

src/Exercise/FilteredLs.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,13 @@
77
use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface;
88
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
99
use PhpSchool\PhpWorkshop\Exercise\TemporaryDirectoryTrait;
10-
use PhpSchool\PhpWorkshop\ExerciseCheck\StdOutExerciseCheck;
11-
use PhpSchool\PhpWorkshop\ExerciseDispatcher;
1210
use Symfony\Component\Filesystem\Filesystem;
1311

1412
class FilteredLs extends AbstractExercise implements ExerciseInterface, CliExercise
1513
{
1614
use TemporaryDirectoryTrait;
1715

18-
/**
19-
* @var Filesystem
20-
*/
21-
private $filesystem;
16+
private Filesystem $filesystem;
2217

2318
public function __construct(Filesystem $filesystem)
2419
{

src/Exercise/HelloWorld.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use PhpSchool\PhpWorkshop\Exercise\CliExercise;
77
use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface;
88
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
9-
use PhpSchool\PhpWorkshop\ExerciseCheck\StdOutExerciseCheck;
10-
use PhpSchool\PhpWorkshop\ExerciseDispatcher;
119

1210
class HelloWorld extends AbstractExercise implements ExerciseInterface, CliExercise
1311
{

src/Exercise/HttpJsonApi.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use PhpSchool\PhpWorkshop\Exercise\CgiExercise;
88
use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface;
99
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
10-
use PhpSchool\PhpWorkshop\ExerciseCheck\CgiOutputExerciseCheck;
1110
use Psr\Http\Message\RequestInterface;
1211

1312
class HttpJsonApi extends AbstractExercise implements ExerciseInterface, CgiExercise

0 commit comments

Comments
 (0)