src/lib/Herrera/Box/StubGenerator.php
public function extract($extract, $force = false)
    {
        $this->extract = $extract;
        $this->extractForce = $force;

        if ($extract) {
            $this->extractCode = array(
                'constants' => array(),
                'class' => array(),
            );

            $compactor = new Php();
            $code = file_get_contents(__DIR__ . '/Extract.php');
            $code = $compactor->compact($code);
            $code = preg_replace('/\n+/', "\n", $code);
            $code = explode("\n", $code);
            $code = array_slice($code, 2);

            foreach ($code as $i => $line) {
                if ((0 === strpos($line, 'use'))
                    && (false === strpos($line, '\\'))
                ) {
                    unset($code[$i]);
                } elseif (0 === strpos($line, 'define')) {
                    $this->extractCode['constants'][] = $line;
                } else {
                    $this->extractCode['class'][] = $line;
                }
            }
        }

        return $this;
    }
public function extract($extract, $force = false)
    {
        $this->extract = $extract;
        $this->extractForce = $force;

        if ($extract) {
            $this->extractCode = array(
                'constants' => array(),
                'class' => array(),
            );

            $compactor = new Php();
            $code = file_get_contents(__DIR__ . '/Extract.php');
            $code = $compactor->compact($code);
            $code = preg_replace('/\n+/', "\n", $code);
            $code = explode("\n", $code);
            $code = array_slice($code, 2);

            foreach ($code as $i => $line) {
                if ((0 === strpos($line, 'use'))
                    && (false === strpos($line, '\\'))
                ) {
                    unset($code[$i]);
                } elseif (0 === strpos($line, 'define')) {
                    $this->extractCode['constants'][] = $line;
                } else {
                    $this->extractCode['class'][] = $line;
                }
            }
        }

        return $this;
    }
public function extract ( $ extract , $ force = false ) { $ this -> extract = $ extract ; $ this -> extractForce = $ force ; if ( $ extract ) { $ this -> extractCode = array ( 'constants' => array ( ) , 'class' => array ( ) , ) ; $ compactor = new Php ( ) ; $ code = file_get_contents ( __DIR__ . '/Extract.php' ) ; $ code = $ compactor -> compact ( $ code ) ; $ code = preg_replace ( '/\n+/' , "\n" , $ code ) ; $ code = explode ( "\n" , $ code ) ; $ code = array_slice ( $ code , 2 ) ; foreach ( $ code as $ i => $ line ) { if ( ( 0 === strpos ( $ line , 'use' ) ) && ( false === strpos ( $ line , '\\' ) ) ) { unset ( $ code [ $ i ] ) ; } elseif ( 0 === strpos ( $ line , 'define' ) ) { $ this -> extractCode [ 'constants' ] [ ] = $ line ; } else { $ this -> extractCode [ 'class' ] [ ] = $ line ; } } } return $ this ; }
Embed the Extract class in the stub?

@param boolean $extract Embed the class?
@param boolean $force   Force the use of the class?

@return StubGenerator The stub generator.
Embed the Extract class in the stub?