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

Entity: fixed enumeration checking for nullable properties #116

Merged
merged 1 commit into from Apr 12, 2018

Conversation

Projects
None yet
1 participant
@janpecha
Collaborator

janpecha commented Jan 17, 2018

Commit (pravděpodobně) 013247e způsobil, že nullable položkám, které mají zároveň m:enum, nelze přiřadit null, tj. následující kód skončí chybou, protože si LM myslí, že null nespadá do výčtu:

/**
 * @property int $id
 * @property string|null $state m:enum(self::STATE_*)
 */
class Author extends LeanMapper\Entity
{
    const STATE_ACTIVE = 'active';
    const STATE_INACTIVE = 'inactive';
}

$author = new Author;
$author->state = NULL; // throws exception
@janpecha

This comment has been minimized.

Show comment
Hide comment
@janpecha

janpecha Jan 17, 2018

Collaborator

Padající testy na PHP 5.4 by měla řešit tahle změna v PR#115

Collaborator

janpecha commented Jan 17, 2018

Padající testy na PHP 5.4 by měla řešit tahle změna v PR#115

@janpecha janpecha added this to the Stable 3.2.0 milestone Apr 12, 2018

@janpecha janpecha merged commit b8f5bb0 into Tharos:develop Apr 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@janpecha janpecha deleted the inlm:pr/enum-null branch Apr 12, 2018

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