Skip to content

Commit fdc8c9c

Browse files
committed
phpstan level 1
1 parent 02816b8 commit fdc8c9c

15 files changed

+57
-57
lines changed

src/CommandArgument.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ public function __construct($name, $optional = false)
2929

3030
/**
3131
* @param string $name
32-
* @return static
32+
* @return self
3333
*/
3434
public static function optional($name)
3535
{
36-
return new static($name, true);
36+
return new self($name, true);
3737
}
3838

3939
/**
4040
* @param string $name
41-
* @return static
41+
* @return self
4242
*/
4343
public static function required($name)
4444
{
45-
return new static($name);
45+
return new self($name);
4646
}
4747

4848
/**

src/Exception/CheckNotApplicableException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class CheckNotApplicableException extends RuntimeException
1717
*
1818
* @param CheckInterface $check The check Instance.
1919
* @param ExerciseInterface $exercise The exercise Instance.
20-
* @return static
20+
* @return self
2121
*/
2222
public static function fromCheckAndExercise(CheckInterface $check, ExerciseInterface $exercise)
2323
{
24-
return new static(
24+
return new self(
2525
sprintf(
2626
'Check: "%s" cannot process exercise: "%s" with type: "%s"',
2727
$check->getName(),

src/Exception/CodeExecutionException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class CodeExecutionException extends RuntimeException
1414
* Static constructor to create an instance from a failed `Symfony\Component\Process\Process` instance.
1515
*
1616
* @param Process $process The `Symfony\Component\Process\Process` instance which failed.
17-
* @return static
17+
* @return self
1818
*/
1919
public static function fromProcess(Process $process)
2020
{
21-
return new static(
21+
return new self(
2222
sprintf(
2323
'PHP Code failed to execute. Error: "%s"',
2424
trim($process->getErrorOutput() ?: $process->getOutput())

src/Exception/ExerciseNotConfiguredException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class ExerciseNotConfiguredException extends RuntimeException
1616
*
1717
* @param ExerciseInterface $exercise The exercise instance.
1818
* @param string $interface The FQCN of the interface.
19-
* @return static
19+
* @return self
2020
*/
2121
public static function missingImplements(ExerciseInterface $exercise, $interface)
2222
{
23-
return new static(sprintf('Exercise: "%s" should implement interface: "%s"', $exercise->getName(), $interface));
23+
return new self(sprintf('Exercise: "%s" should implement interface: "%s"', $exercise->getName(), $interface));
2424
}
2525
}

src/Exception/InvalidArgumentException.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ class InvalidArgumentException extends \InvalidArgumentException
1212
*
1313
* @param string $expected
1414
* @param mixed $actual
15-
* @return static
15+
* @return self
1616
*/
1717
public static function typeMisMatch($expected, $actual)
1818
{
19-
return new static(
19+
return new self(
2020
sprintf(
2121
'Expected: "%s" Received: "%s"',
2222
$expected,
@@ -31,11 +31,11 @@ public static function typeMisMatch($expected, $actual)
3131
* @param string $parameterName
3232
* @param mixed[] $allowedValues
3333
* @param mixed $actualValue
34-
* @return static
34+
* @return self
3535
*/
3636
public static function notValidParameter($parameterName, array $allowedValues, $actualValue)
3737
{
38-
return new static(
38+
return new self(
3939
sprintf(
4040
'Parameter: "%s" can only be one of: "%s" Received: "%s"',
4141
$parameterName,
@@ -48,11 +48,11 @@ public static function notValidParameter($parameterName, array $allowedValues, $
4848
/**
4949
* @param object $object
5050
* @param string $requiredInterface
51-
* @return static
51+
* @return self
5252
*/
5353
public static function missingImplements($object, $requiredInterface)
5454
{
55-
return new static(
55+
return new self(
5656
sprintf(
5757
'"%s" is required to implement "%s", but it does not',
5858
get_class($object),

src/Result/Cgi/GenericFailure.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ public function __construct(RequestInterface $request, $reason = null)
3737
*
3838
* @param RequestInterface $request The request that caused the failure.
3939
* @param string|null $reason The reason (if any) of the failure.
40-
* @return static The result.
40+
* @return self The result.
4141
*/
4242
public static function fromRequestAndReason(RequestInterface $request, $reason)
4343
{
44-
return new static($request, $reason);
44+
return new self($request, $reason);
4545
}
4646

4747
/**
4848
* Static constructor to create from a `PhpSchool\PhpWorkshop\Exception\CodeExecutionException` exception.
4949
*
5050
* @param RequestInterface $request The request that caused the failure.
5151
* @param CodeExecutionException $e The exception.
52-
* @return static The result.
52+
* @return self The result.
5353
*/
5454
public static function fromRequestAndCodeExecutionFailure(RequestInterface $request, CodeExecutionException $e)
5555
{
56-
return new static($request, $e->getMessage());
56+
return new self($request, $e->getMessage());
5757
}
5858

5959
/**

src/Result/Cli/GenericFailure.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ public function __construct(ArrayObject $args, $reason = null)
3636
*
3737
* @param ArrayObject $args The arguments that caused the failure.
3838
* @param string|null $reason The reason (if any) of the failure.
39-
* @return static The result.
39+
* @return self The result.
4040
*/
4141
public static function fromArgsAndReason(ArrayObject $args, $reason)
4242
{
43-
return new static($args, $reason);
43+
return new self($args, $reason);
4444
}
4545

4646
/**
4747
* Static constructor to create from a `PhpSchool\PhpWorkshop\Exception\CodeExecutionException` exception.
4848
*
4949
* @param ArrayObject $args The arguments that caused the failure.
5050
* @param CodeExecutionException $e The exception.
51-
* @return static The result.
51+
* @return self The result.
5252
*/
5353
public static function fromArgsAndCodeExecutionFailure(ArrayObject $args, CodeExecutionException $e)
5454
{
55-
return new static($args, $e->getMessage());
55+
return new self($args, $e->getMessage());
5656
}
5757

5858
/**

src/Result/Cli/RequestFailure.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public function __construct(ArrayObject $args, $expectedOutput, $actualOutput)
4343
* @param ArrayObject $args The arguments that caused the failure.
4444
* @param string $expectedOutput The expected result.
4545
* @param string $actualOutput The actual output.
46-
* @return static The result.
46+
* @return self The result.
4747
*/
4848
public static function fromArgsAndOutput(ArrayObject $args, $expectedOutput, $actualOutput)
4949
{
50-
return new static($args, $expectedOutput, $actualOutput);
50+
return new self($args, $expectedOutput, $actualOutput);
5151
}
5252

5353
/**

src/Result/ComparisonFailure.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public function __construct($name, $expectedValue, $actualValue)
3838
* @param string $name
3939
* @param string $expectedValue
4040
* @param string $actualValue
41-
* @return static
41+
* @return self
4242
*/
4343
public static function fromNameAndValues($name, $expectedValue, $actualValue)
4444
{
45-
return new static($name, $expectedValue, $actualValue);
45+
return new self($name, $expectedValue, $actualValue);
4646
}
4747

4848
/**

src/Result/Failure.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,35 @@ public function __construct($name, $reason = null)
3939
*
4040
* @param string $name The name of the check that produced this result.
4141
* @param string|null $reason The reason (if any) of the failure.
42-
* @return static The result.
42+
* @return self The result.
4343
*/
4444
public static function fromNameAndReason($name, $reason)
4545
{
46-
return new static($name, $reason);
46+
return new self($name, $reason);
4747
}
4848

4949
/**
5050
* Static constructor to create from an instance of `PhpSchool\PhpWorkshop\Check\CheckInterface`.
5151
*
5252
* @param CheckInterface $check The check instance.
5353
* @param string $reason The reason (if any) of the failure.
54-
* @return static The result.
54+
* @return self The result.
5555
*/
5656
public static function fromCheckAndReason(CheckInterface $check, $reason)
5757
{
58-
return new static($check->getName(), $reason);
58+
return new self($check->getName(), $reason);
5959
}
6060

6161
/**
6262
* Static constructor to create from a `PhpSchool\PhpWorkshop\Exception\CodeExecutionException` exception.
6363
*
6464
* @param string $name The name of the check that produced this result.
6565
* @param CodeExecutionException $e The exception.
66-
* @return static The result.
66+
* @return self The result.
6767
*/
6868
public static function fromNameAndCodeExecutionFailure($name, CodeExecutionException $e)
6969
{
70-
return new static($name, $e->getMessage());
70+
return new self($name, $e->getMessage());
7171
}
7272

7373
/**
@@ -77,11 +77,11 @@ public static function fromNameAndCodeExecutionFailure($name, CodeExecutionExcep
7777
* @param CheckInterface $check The check that attempted to parse the solution.
7878
* @param ParseErrorException $e The parse exception.
7979
* @param string $file The absolute path to the solution.
80-
* @return static The result.
80+
* @return self The result.
8181
*/
8282
public static function fromCheckAndCodeParseFailure(CheckInterface $check, ParseErrorException $e, $file)
8383
{
84-
return new static(
84+
return new self(
8585
$check->getName(),
8686
sprintf('File: "%s" could not be parsed. Error: "%s"', $file, $e->getMessage())
8787
);

0 commit comments

Comments
 (0)