Skip to content

Conversation

@andypost
Copy link
Contributor

Related to #1477 and #1478

@andypost
Copy link
Contributor Author

andypost commented Nov 6, 2024

@jakzal please trigger pipelines again

@jrfnl
Copy link
Contributor

jrfnl commented Dec 10, 2024

IIRC Prophecy has tagged a version which should be compatible with PHP 8.4, so hopefully retriggering the build should allow to get a passing build.

@andypost
Copy link
Contributor Author

It needs a bit more, moreover declare compatibility in composer.json

ref #1477

@jrfnl
Copy link
Contributor

jrfnl commented Dec 10, 2024

@andypost Well, that would be nice, but that can be overcome with a --ignore-platform-req=php+.

@andypost
Copy link
Contributor Author

@jrfnl this change is added in #1476

@MarcelloDuarte
Copy link
Member

@andypost looking at the branches now, seems like the thinking is that branch 7.x would be kept for bug fixes; while main would be for phpspec 8, which will then support php >=8.4. Not really a major release reason... just seems that branches are set this way.

This was loosely observed in conversation with @Jean85. But, I don't think either of us are locked to any direction. It would also make sense to have 7.7.0 supporting php 8.4. I am easy.

What do you folks think? /cc @Jean85 @torchello

@Jean85
Copy link
Contributor

Jean85 commented May 17, 2025

I agree that adding support for 8.4 is not a reason for a new major. But the main branch also dropped support for 8.0 and below (which is not a reason for a major bump too) while also applying many types here and there, and those may require a major bump, due to subtle breaking changes.

I'm not sure if there's an actual breaking change, we would need to inspect the diff to ascertain it. IIRC, the most notable change is that in some places a return type was added, and that would break extending classes (see https://3v4l.org/qMIjP). If that was done on a non internal, non final class, it would be a BC.

@Jean85
Copy link
Contributor

Jean85 commented May 19, 2025

I started scanning the diff, but there's A LOT to read. I stopped at the IO folder, and this is what I fnd that qualify as BC:

TL;DR: I fear a major bump is needed; otherwise, we need to revert a lot of code...

Constructors with (now) typed arguments

  • OptionsConfig::__construct last 2 arguments are now typed
        private ?string $bootstrapPath,
        private bool $isVerbose
  • ExpectationEvent::__construct last 5 arguments are now typed
        private mixed $subject,
        private string $method,
        private array $arguments,
        private int $result = self::PASSED,
        private ?Exception $exception = null
  • MethodCallEvent::__construct last 4 arguments are now typed
        private object $subject,
        private string $method,
        private array $arguments,
        private mixed $returnValue = null)
  • MethodFailureException::__construct last 4 arguments are now typed
        mixed $expected,
        mixed $actual,
        private object $subject,
        private string $method)
  • NotEqualException::__construct last 2 arguments are now typed
        private mixed $expected,
        private mixed $actual
  • StopOnFailureException::__construct arguments are now typed
        string $message = "",
        int $code = 0,
        ?Exception $previous = null,
        private int $result = 0)
  • InterfaceNotImplementedException::__construct last 2 arguments are now typed
        private mixed $subject,
        private string $interface
  • InterfaceNotImplementedException::__construct middle 2 arguments are now typed
        private object $subject,
        private string $method,
  • PropertyNotFoundException::__construct last 2 arguments are now typed
        private object $subject,
        private string $property
  • MatcherNotFoundException::__construct1 argument is now typed
        private string $subject,

Methods with a new return type, and the class is neither final nor @internal:

  • OptionsConfig::getBootstrapPath: ?string
  • ConsoleIO::cutTemp(): ?string
  • ExampleEvent::getException() : ?Exception
  • ExpectationEvent::getSubject() : mixed
  • ExpectationEvent::getException() : ?Exception
  • MethodCallEvent::getSubject() : object
  • MethodCallEvent::getReturnValue() : mixed
  • MethodFailureException::getSubject() : ?object
  • MethodFailureException::getMethod() : string
  • NotEqualException::getExpected() : mixed
  • NotEqualException::getActual() : mixed
  • StopOnFailureException::getResult() : int
  • InterfaceNotImplementedException::getSubject() : mixed
  • MethodInvocationException::getSubject() : object
  • PropertyNotFoundException::getSubject() : object
    *MatcherNotFoundException::getSubject() : string
  • ObjectFactory::instantiateFromCallable(...): object
  • ReportItemFactory::create(...): ReportFailedItem|ReportPassedItem|ReportPendingItem|ReportSkippedItem
  • Differ::compare(mixed $expected, mixed $actual) : ?string
  • CallArgumentsPresenter::findFirstUnexpectedArgumentsCallProphecy(...): ?MethodProphecy
  • BasicFormatter beforeSuite, afterSuite, beforeExample, afterExample, beforeSpecification, afterSpecification methods now return void

@MarcelloDuarte
Copy link
Member

Thanks @Jean85,

Sounds like we should keep the main for 8.x and 7.x for bug fixes

@torchello
Copy link
Contributor

@MarcelloDuarte @stof Let's close this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants