Nelmio\Alice\ObjectBag::without PHP Method

without() public method

Creates a new instance which will no longer contain the given object.
public without ( Nelmio\Alice\FixtureInterface | Nelmio\Alice\ObjectInterface $objectOrFixture ) : self
$objectOrFixture Nelmio\Alice\FixtureInterface | Nelmio\Alice\ObjectInterface
return self
    public function without($objectOrFixture) : self
    {
        $clone = clone $this;
        unset($clone->objects[$objectOrFixture->getId()]);
        unset($clone->array[$objectOrFixture->getId()]);
        return $clone;
    }