Permalink
Switch branches/tags
Nothing to show
Commits on Jun 27, 2012
  1. Fix return statement for the method.

    marijn committed Jun 27, 2012
    The method now correctly returns the calculated value (i.e.  when
    the date is not contained in the date range and  if it is).
Commits on Apr 23, 2012
  1. Revert "Change comparison for key assertion."

    marijn committed Apr 23, 2012
    This reverts commit e8cdf9c. It appears that
    the reason for unexpected results was to blame on the client code.
Commits on Apr 12, 2012
  1. Fix return value.

    marijn committed Apr 12, 2012
Commits on Apr 11, 2012
Commits on Apr 4, 2012
  1. Add method to test if the key *fits* the lock.

    marijn committed Apr 4, 2012
    Example:
    
    ```php
    <?php
    
    $secret = '$3crt3t';
    
    // Create a Lock that is locked
    $lock = new Spil\Lock(new Spil\LockState\LockedState(), $secret);
    $key = new Spil\Key("invalid");
    
    if ($lock->fits(key)) {
        $lock->unlock(key);
    } else {
        printf("The key %s does not fit", key);
    }
    ```
Commits on Apr 3, 2012
Commits on Mar 26, 2012
  1. Expose the teeth for the lock.

    marijn committed Mar 26, 2012
    This should be replaced by implementing some sort of memento pattern.
Commits on Mar 23, 2012
  1. Fix file names.

    marijn committed Mar 23, 2012
    The file names are now compatible with the underlying class names.
  2. Change object constructor.

    marijn committed Mar 23, 2012
    The `from` and `until` fields are now optional.
Commits on Mar 21, 2012
  1. Add implementation for null locks.

    marijn committed Mar 21, 2012
    A null lock is useful when the lock might not always be present.
    
    Usage:
    
        $lock = new Spil\Lock(new Spil\LockState\NullLockState());
    
        if ($lock->getState() instanceof Spil\LockState\NullLockStateInterface) {
            throw new DomainException('No valid lock available');
        }
  2. Add composer configuration.

    marijn committed Mar 21, 2012
  3. Add namespaces.

    marijn committed Mar 21, 2012
  4. Fix typo.

    marijn committed Mar 21, 2012
Commits on Mar 20, 2012
  1. Add factory class to ease the construction of locks.

    marijn committed Mar 20, 2012
    Usage:
    
        $facatory = new LockFactory();
        $lock = $factory->createUnlockedLock("secret");
  2. Fix markdown formatting.

    marijn committed Mar 20, 2012
  3. Add example for a time lock.

    marijn committed Mar 20, 2012
  4. Add lock states for temporal locks.

    marijn committed Mar 20, 2012
    Usage:
    
        $lock = new Lock(new TemporalLockedState(new Timeframe(new DateTime('10 days ago'), new DateTime('yesterday'))));
    
        // throw DomainException: Timelock active
        $lock->unlock();
  5. Change argument order for `Lock` constructor.

    marijn committed Mar 20, 2012
    This allows for the creation of `null` locks.
  6. Add missing `Key` class.

    marijn committed Mar 20, 2012