Ad
  • Custom User Avatar

    Actual and expected order is not consistent, sometimes they're ok and sometimes they're flipped. The right order is expected first, then actual. At least in sample tests.

  • Custom User Avatar

    From Voile's post below, that operation translates to this:
    0 / 117 -> 0 / 89 -> 0
    Actual and expected seems to be flipped on some tests.

  • Custom User Avatar

    Call to a value or operation should resolve to a primitive integer (round down to the nearest integer, if necessary) and returns the most recent calculation value.

    3 / 6 = 0
    0 * 10 = 0
    0 + 3 = 3
    3 - 7 = -4
    

    It's been mentioned below by u-mulder

  • Default User Avatar

    I believe there is something wrong with one of the tests for PHP or with the explanation. According to the example in the explanation every calculation should be resolved from left to right without taking into account the order of operations.

    The following test doesn't seem to agree with this rule:

    $this->assertSame(-4, FluentCalculator::init()->three->dividedBy->six->times->one->zero->plus->three->minus->seven());
    
    3 / 6 = 0.5
    0.5 * 10 = 5
    5 + 3 = 8
    8 - 7 = 1
    

    Following the logic from left to right it results in 1, but the test expects -4. Is the test wrong or am I wrong?

  • Default User Avatar

    Bonus points for naming: Unraveller and ->unravel().

  • Default User Avatar

    I experienced this issue today. Are you sure it's fixed?