Skip to content

Moving callback firing code into its own method.#6

Merged
hobnob merged 1 commit intohobnob:masterfrom
jamesmoss:master
Oct 22, 2013
Merged

Moving callback firing code into its own method.#6
hobnob merged 1 commit intohobnob:masterfrom
jamesmoss:master

Conversation

@jamesmoss
Copy link

I've just refactored the end method, pulling out the code that creates a SimpleXMLElement and calls call_user_func_array into it's own method named fireCallbacks.

My use case for this is that I want to use xmlStreamReader to count the number of times a path is matched in large XML docs. Speed is important so I don't want the overhead of creating a SimpleXMLElement object and calling call_user_func_array everytime a path is matched. In my own class I'm planning to extend Parser and override fireCallbacks to increment a counter var instead.

@hobnob
Copy link
Owner

hobnob commented Oct 22, 2013

@jamesmoss Cool, looks nice. Thanks! :-)

hobnob added a commit that referenced this pull request Oct 22, 2013
Moving callback firing code into its own method.
@hobnob hobnob merged commit d7986e1 into hobnob:master Oct 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants