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

Make all assertions return true on success, so that it can be used inside PHP 7 assert() #136

Closed
danizord opened this issue Feb 19, 2016 · 3 comments
Milestone

Comments

@danizord
Copy link

/**
 * @param ThingInterface[] $things
 */
public function __construct(array $things)
{
    // no-op on production environment! :D
    assert(Assertion::allIsInstanceOf($things, ThingInterface::class));

    $this->things = $things;
}

@beberlei what do you think?

@danizord danizord changed the title Make all assertions return true so that it can be used inside PHP 7 assert() Make all assertions return true on success, so that it can be used inside PHP 7 assert() Feb 19, 2016
@gabrielsch
Copy link

good feature, and not bc break. 👍

@stof
Copy link

stof commented May 3, 2016

this looks good to me indeed

@rquadling
Copy link
Contributor

Care to make a pull request? If it is non breaking, then will be easier to add.

@rquadling rquadling added this to the 2.7 milestone Oct 5, 2016
VaclavSir added a commit to VaclavSir/berbelei-assert that referenced this issue Oct 30, 2016
rquadling pushed a commit that referenced this issue Oct 31, 2016
Also allow PHP 7.1 to fail due to https://bugs.php.net/bug.php?id=73426
Fixed .json file formatting via .editorConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants