Fixed an infinite loop after calling stop or expunge on PHP entities. 

The stop operation of the PHP entity was fixed.
Before, Brooklyn found a error when the user stopped or expunged an application.