Skip to content

Commit b84e344

Browse files
Merge pull request #1493 from torchello/add-php-8.4
2 parents 62822ee + 2418eaa commit b84e344

File tree

6 files changed

+28
-5
lines changed

6 files changed

+28
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: ["8.2", "8.3"]
17+
php: ["8.2", "8.3", "8.4"]
1818
operating-system: [ ubuntu-latest, macOS-latest, windows-latest ]
1919
composer-flags: [""]
2020
composer-extras: [""]

CHANGES-v8.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [8.0.0](https://github.com/phpspec/phpspec/compare/7.6.0...8.0.0)
88

9-
[Unreleased]: https://github.com/phpspec/phpspec/compare/7.5...main
9+
### Added
10+
- PHP 8.4 compatibility [@jrfnl](https://github.com/jrfnl) [@andypost](https://github.com/andypost)

integration/PhpSpec/Console/Prompter/QuestionTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ function it_can_ask_a_question_and_return_the_result()
6464
->with(
6565
$this->identicalTo($this->input),
6666
$this->identicalTo($this->output),
67-
$this->equalTo(new ConfirmationQuestion('Are you sure?', true))
67+
$this->callback(function ($question) {
68+
return $question instanceof ConfirmationQuestion
69+
&& $question->getQuestion() === 'Are you sure?'
70+
&& $question->getDefault() === true;
71+
}),
6872
)
6973
->willReturn(true);
7074

src/PhpSpec/Loader/Node/SpecificationNode.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class SpecificationNode implements \Countable
2727
*/
2828
private array $examples = [];
2929

30+
/**
31+
* @param string $title
32+
* @param ReflectionClass<Specification> $class
33+
* @param Resource $resource
34+
*/
3035
public function __construct(
3136
private string $title,
3237
private ReflectionClass $class,

src/PhpSpec/Loader/ResourceLoader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ private function lineIsInsideMethod(int $line, ReflectionMethod $method): bool
105105
private function addErrorThrowingExampleToSuite(Resource $resource, Suite $suite, \Error $error) : void
106106
{
107107
$reflection = new ReflectionClass(ErrorSpecification::class);
108+
/** @var ReflectionClass<Specification> $reflection */
108109
$spec = new Node\SpecificationNode($resource->getSrcClassname(), $reflection, $resource);
109110

110111
$errorFunction = new \ReflectionFunction(

src/PhpSpec/Runner/Maintainer/CollaboratorsMaintainer.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ public function getPriority(): int
7777
return 50;
7878
}
7979

80+
/**
81+
* @param CollaboratorManager $collaborators
82+
* @param \ReflectionFunctionAbstract $function
83+
* @param \ReflectionClass<Specification> $classRefl
84+
* @return void
85+
* @throws CollaboratorNotFoundException
86+
* @throws InvalidCollaboratorTypeException
87+
*/
8088
private function generateCollaborators(CollaboratorManager $collaborators, \ReflectionFunctionAbstract $function, \ReflectionClass $classRefl): void
8189
{
8290
foreach ($function->getParameters() as $parameter) {
@@ -136,7 +144,11 @@ private function throwCollaboratorNotFound(\Exception $e, ?\ReflectionParameter
136144
);
137145
}
138146

139-
/** @return ?class-string */
147+
/**
148+
* @param \ReflectionClass<Specification> $classRefl
149+
* @param \ReflectionParameter $parameter
150+
* @return ?class-string
151+
*/
140152
private function getParameterTypeFromIndex(\ReflectionClass $classRefl, \ReflectionParameter $parameter): ?string
141153
{
142154
return $this->typeHintIndex->lookup(

0 commit comments

Comments
 (0)