• Darren (unregistered)

    I wonder if this was originally some kind of check to limit the number of attachments - between 1 and 10 is fine, any more then do something else - but the requirement was changed and this is the remnants that are left 'just in case' the requirements come back.

  • (nodebb) in reply to Darren

    but the requirement was changed and this is the remnants that are left 'just in case' the requirements come back

    More likely it was one of those "make the minimum changes possible" situations, as in the case below:

    if ( there are entries in the array )
    {
        // do some stuff that might remove no entries, some entries, or all entries
         ...
    
        if ( there are (still) entries in the array )
        {
            // do some other stuff that might output a supplementary line of text if there are entries
            ...
    
            foreach ( $files as $file )
            {
                 // addAttachment stuff
            }
        }
    }
    

    And then the requirement for removing no/some/all entries disappeared, and then the requirement for the other stuff disappeared, so only the if()s remain outside the foreach(). (Removing the if()s would count as making more changes than the minimum possible, so they remain with us.)

  • RLB (unregistered)

    This screams "git merge error" to me.

  • erffrfez (unregistered) in reply to RLB
    Comment held for moderation.

Leave a comment on “Are There Files Yet?”

Log In or post as a guest

Replying to comment #:

« Return to Article