Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce native type-hints and pass-by-reference values #295

Merged
merged 4 commits into from
Mar 2, 2024

Conversation

boesing
Copy link
Member

@boesing boesing commented Feb 29, 2024

Q A
BC Break yes
QA yes

Description

This introduces almost all native type-hints. Those which are missing are either related to laminas-eventmanager or laminas-servicemanager. The latter will be updated in one of the next PRs.

This fixes #15

@boesing boesing added this to the 4.0.0 milestone Feb 29, 2024
@boesing boesing changed the base branch from 3.13.x to 4.0.x February 29, 2024 01:08
@boesing
Copy link
Member Author

boesing commented Feb 29, 2024

This contains all changes of #294 as well.

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only managed to look at very superficial level: test changes OK, only change that is a bit weird is callable|string types, which I think is wrong 🤔

src/Pattern/CallbackCache.php Outdated Show resolved Hide resolved
src/Pattern/ObjectCache.php Outdated Show resolved Hide resolved
@boesing
Copy link
Member Author

boesing commented Mar 1, 2024

Will double check that again. Problem is that it was "callable" beforehand and I am unsure if it allows strings pointing to functions.

@Ocramius
Copy link
Member

Ocramius commented Mar 1, 2024

Will double check that again. Problem is that it was "callable" beforehand and I am unsure if it allows strings pointing to functions.

see https://3v4l.org/qCIk0

<?php

function useCallable($input, callable $cb): mixed {
    return $cb($input);
}

var_dump(useCallable('123', 'intval'));
var_dump(useCallable('', 'intval'));
var_dump(useCallable('foo', 'intval'));
var_dump(useCallable(123.456, 'intval'));

@boesing boesing force-pushed the qa/introduce-native-types branch 2 times, most recently from 79ca364 to b07e369 Compare March 2, 2024 21:49
…reference values

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing linked an issue Mar 2, 2024 that may be closed by this pull request
@boesing boesing merged commit 3eaa2c0 into laminas:4.0.x Mar 2, 2024
17 of 18 checks passed
@boesing boesing deleted the qa/introduce-native-types branch March 2, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants