protected function getOpenAndClosingPhpTokens($contents)
    {
        return collect(token_get_all($contents))
            ->pluck($tokenNumber = 0)
            ->filter(function ($token) {
                return in_array($token, [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_CLOSE_TAG]);
            });
    }
protected function getOpenAndClosingPhpTokens($contents)
    {
        return collect(token_get_all($contents))
            ->pluck($tokenNumber = 0)
            ->filter(function ($token) {
                return in_array($token, [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_CLOSE_TAG]);
            });
    }
protected function getOpenAndClosingPhpTokens ( $ contents ) { return collect ( token_get_all ( $ contents ) ) -> pluck ( $ tokenNumber = 0 ) -> filter ( function ( $ token ) { return in_array ( $ token , [ T_OPEN_TAG , T_OPEN_TAG_WITH_ECHO , T_CLOSE_TAG ] ) ; } ) ; }
Get the open and closing PHP tag tokens from the given string.

@param  string  $contents
@return \Illuminate\Support\Collection
Get the open and closing PHP tag tokens from the given string .