Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Created October 12, 2015 15:25
Show Gist options
  • Select an option

  • Save ircmaxell/c128db520476ff45bc94 to your computer and use it in GitHub Desktop.

Select an option

Save ircmaxell/c128db520476ff45bc94 to your computer and use it in GitHub Desktop.

Revisions

  1. ircmaxell created this gist Oct 12, 2015.
    28 changes: 28 additions & 0 deletions soimething.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    <?php

    function doStuff() {
    //blah
    //blah
    if (!$this->isWhateverCondition(blah, blah, blah)) {
    return false;
    }
    }

    function isWhateverConditionName($setMarkerPosition, $setClosingName, $name, $nameClose) {
    if(!$this->match(self::TOKEN_OPEN, null, true)) {
    return false;
    }
    if(!$this->match(self::TOKEN_MARKER, $setMarkerPosition, true)) {
    return false;
    }
    if(!$this->match(self::TOKEN_STRING, $setClosingName, true)) {
    return false;
    }
    if(!$this->match(self::TOKEN_CLOSE)) {
    return false;
    }
    if($name !== $nameClose) {
    return false;
    }
    return true;
    }