Clim/Helper/DeferredDefinitionTrait.php
protected function needDefined()
    {
        if ($this->defined) return;
        $this->defined = true;

        $name = $pattern = $note = null;

        if (preg_match(PARSER_PATTERN, $this->definition, $matches)) {
            $body = $matches[1];
            $name = $matches[2];
            $note = $matches[3];

            $pos = strpos($name, '|');
            if ($pos !== false) {
                $pattern = $this->assertPattern(trim(substr($name, $pos + 1)));

                $name = trim(substr($name, 0, $pos));
            }
        } else {
            $body = $this->definition;
        }

        $this->define($body, $name, $pattern, $note);
    }
protected function needDefined()
    {
        if ($this->defined) return;
        $this->defined = true;

        $name = $pattern = $note = null;

        if (preg_match(PARSER_PATTERN, $this->definition, $matches)) {
            $body = $matches[1];
            $name = $matches[2];
            $note = $matches[3];

            $pos = strpos($name, '|');
            if ($pos !== false) {
                $pattern = $this->assertPattern(trim(substr($name, $pos + 1)));

                $name = trim(substr($name, 0, $pos));
            }
        } else {
            $body = $this->definition;
        }

        $this->define($body, $name, $pattern, $note);
    }
protected function needDefined ( ) { if ( $ this -> defined ) return ; $ this -> defined = true ; $ name = $ pattern = $ note = null ; if ( preg_match ( PARSER_PATTERN , $ this -> definition , $ matches ) ) { $ body = $ matches [ 1 ] ; $ name = $ matches [ 2 ] ; $ note = $ matches [ 3 ] ; $ pos = strpos ( $ name , '|' ) ; if ( $ pos !== false ) { $ pattern = $ this -> assertPattern ( trim ( substr ( $ name , $ pos + 1 ) ) ) ; $ name = trim ( substr ( $ name , 0 , $ pos ) ) ; } } else { $ body = $ this -> definition ; } $ this -> define ( $ body , $ name , $ pattern , $ note ) ; }
Ensure definition has been parsed before actual use.
It is safe to call it multiple times.
Ensure definition has been parsed before actual use . It is safe to call it multiple times .