PHP Parse error: syntax error, unexpected T_PUBLIC
<p>I am getting this error on the following line <code>public function edit_sale( $sale_id = 0 ){</code> </p>

<p>I cannot seem to spot an issue this is happening on line 159 of a document that has other similar functions above it.  Ideas?</p>

<p><strong>Code:</strong></p>

<pre><code>&lt;?php defined('BASEPATH') or exit('No direct script access allowed');

class Admin extends Admin_Controller {

    protected $sale_rules = array(
                                array(
                                    'field' =&gt; 'location',
                                    'label' =&gt; 'lang:sales.sale_location',
                                    'rules' =&gt; 'trim|required|max_length[250]'
                                ),
                                array(
                                    'field' =&gt; 'slug',
                                    'label' =&gt; 'lang:sales.sale_slug',
                                    'rules' =&gt; 'trim|required|strtolower|max_length[60]'
                                ),
                                array(
                                    'field' =&gt; 'bedrooms',
                                    'label' =&gt; 'lang:sales.sale_bedrooms',
                                    'rules' =&gt; 'trim|required|integer|max_length[3]'
                                 ),
                                array(
                                    'field' =&gt; 'bathrooms',
                                    'label' =&gt; 'lang:sales.sale_bathrooms',
                                    'rules' =&gt; 'trim|required|integer|max_length[3]'
                               ),
                               array(
                                    'field' =&gt; 'property_type',
                                    'label' =&gt; 'lang:sales.sale_property_type',
                                    'rules' =&gt; 'trim|required|max_length[150]'
                            ),
                              array(
                                    'field' =&gt; 'floor_area',
                                    'label' =&gt; 'lang:sales.sale_floor_area',
                                    'rules' =&gt; 'trim|required|max_length[150]'
                                    ),
                             array(
                                'field' =&gt; 'price',
                                'label' =&gt; 'lang:sales.sale_price',
                                'rules' =&gt; 'trim|required|integer|max_length[8]'
                                    ),
                            array(
                                'field' =&gt; 'description',
                                 'label' =&gt; 'lang:sales.sale_description',
                                 'rules' =&gt; 'trim|required'
                                )


    );
    // --------------------------------------------------------------------------

    public function __construct()
    {
        parent::Admin_Controller();

        $this-&gt;load-&gt;model('sales_m');

        $this-&gt;load-&gt;language('sales');

        $this-&gt;template-&gt;set_partial('shortcuts', 'admin/shortcuts');
    }

    // --------------------------------------------------------------------------
    // CRUD Functions
    // --------------------------------------------------------------------------

    public function index()
    {
        $this-&gt;list_sales();
    }

    // --------------------------------------------------------------------------

    /**
     * List sales
     *
     */
    public function list_sales( $offset = 0 )
    {   
        // -------------------------------------
        // Get sales
        // -------------------------------------

        $this-&gt;template-&gt;sales = $this-&gt;sales_m-&gt;get_sales( $this-&gt;settings-&gt;item('records_per_page'), $offset );

        // -------------------------------------
        // Pagination
        // -------------------------------------

        $total_rows = $this-&gt;sales_m-&gt;count_all();

        $this-&gt;template-&gt;pagination = create_pagination('admin/sales/list_sales', $total_rows);

        // -------------------------------------

        $this-&gt;template-&gt;build('admin/list_sales');
    }

    // --------------------------------------------------------------------------

    /**
     * Create a new sale
     *
     */
    function create_sale()
    {       
        $this-&gt;template-&gt;append_metadata( js('debounce.js', 'sales') );        
        $this-&gt;template-&gt;append_metadata( js('new_sale.js', 'sales') );        

        // -------------------------------------
        // Validation &amp; Setup
        // -------------------------------------

        $this-&gt;load-&gt;library('form_validation');

        $this-&gt;sale_rules[1]['rules'] .= '|callback__check_slug[insert]';

        $this-&gt;form_validation-&gt;set_rules( $this-&gt;sale_rules );

        foreach($this-&gt;sale_rules as $key =&gt; $rule)
        {
            $sale-&gt;{$rule['field']} = $this-&gt;input-&gt;post($rule['field'], TRUE);
        }

        // -------------------------------------
        // Process Data
        // -------------------------------------

        if ($this-&gt;form_validation-&gt;run())
        {
            if( ! $this-&gt;sales_m-&gt;insert_new_sale( $sale, $this-&gt;user-&gt;id ) ):
            {
                $this-&gt;session-&gt;set_flashdata('notice', lang('sales.new_sale_error'));  
            }
            else:
            {
                $this-&gt;session-&gt;set_flashdata('success', lang('sales.new_sale_success'));   
            }
            endif;

            redirect('admin/sales');
        }

        // -------------------------------------

    // --------------------------------------------------------------------------

    /**
     * Edit a sale
     *
     */
    public function edit_sale( $sale_id = 0 )
    {       
        $this-&gt;template-&gt;append_metadata( js('debounce.js', 'sales') );        
        $this-&gt;template-&gt;append_metadata( js('new_sale.js', 'sales') );        

        // -------------------------------------
        // Validation &amp; Setup
        // -------------------------------------

        $this-&gt;load-&gt;library('form_validation');

        $this-&gt;sale_rules[1]['rules'] .= '|callback__check_slug[update]';

        $this-&gt;form_validation-&gt;set_rules( $this-&gt;sale_rules );

        // -------------------------------------
        // Get sale data
        // -------------------------------------

        $sale = $this-&gt;sales_m-&gt;get_sale( $sale_id );

        $sale-&gt;content = $this-&gt;sales_m-&gt;process_type( $sale-&gt;location, $sale-&gt;bedrooms, $sale-&gt;bathrooms, $sale-&gt;property_type, $sale-&gt;floor_area, $sale-&gt;price, $sale-&gt;description, 'outgoing' );

        // -------------------------------------
        // Process Data
        // -------------------------------------

        if ($this-&gt;form_validation-&gt;run())
        {
            foreach($this-&gt;sale_rules as $key =&gt; $rule)
            {
                $sale-&gt;{$rule['field']} = $this-&gt;input-&gt;post($rule['field'], TRUE);
            }
            if( ! $this-&gt;sales_m-&gt;update_sale( $sale, $sale_id ) ):
            {
                $this-&gt;session-&gt;set_flashdata('notice', lang('sales.update_sale_error'));   
            }
            else:
            {
                $this-&gt;session-&gt;set_flashdata('success', lang('sales.update_sale_success'));    
            }
            endif;

            redirect('admin/sales');
        }

        // -------------------------------------

        $this-&gt;template-&gt;set('sale', $sale)-&gt;build('admin/edit');
    }

    // --------------------------------------------------------------------------

    /**
     * Delete a sale
     *
     */
    function delete_sale( $sale_id = 0 )
    {       
        if( ! $this-&gt;sales_m-&gt;delete_sale( $sale_id ) ):
        {
            $this-&gt;session-&gt;set_flashdata('notice', lang('sales.delete_sale_error'));   
        }
        else:
        {
            $this-&gt;session-&gt;set_flashdata('success', lang('sales.delete_sale_success'));    
        }
        endif;

        redirect('admin/sales');
    }

    // --------------------------------------------------------------------------

    /**
     * Create stream slug.
     *
     * Accessed via AJAX
     */
    function stream_slug()
    {
        $this-&gt;load-&gt;helper('text');

        $this-&gt;output-&gt;set_output( url_title($this-&gt;input-&gt;post('location'), 'underscore', TRUE) );
    }

    // --------------------------------------------------------------------------
    // Validation Callbacks
    // --------------------------------------------------------------------------

    /**
     * Check slug to make sure it is 
     *
     * @param   string - slug to be tested
     * @param   mode - update or insert
     * @return  bool
     */
    function _check_slug( $slug, $mode )
    {
        $obj = $this-&gt;db-&gt;where('slug', $slug)-&gt;get('sales');

        if( $mode == 'update' ):

            $threshold = 1;

        else:

            $threshold = 0;

        endif;

        if( $obj-&gt;num_rows &gt; $threshold ):

            $this-&gt;form_validation-&gt;set_message('_check_slug', lang('sales.slug_unique'));

            return FALSE;

        else:

            return TRUE;

        endif;
    }
}

/* End of file admin.php */
/* Location: ./addons/modules/sales/controllers/admin.php */
</code></pre>
