(a) Upon complaint on oath by any Attorney for the Commonwealth or assistant Attorney for the Commonwealth or by any two police officers, to any judge of the Court of Common Pleas or an appellate court justice or judge, that such Attorney for the Commonwealth or police officers have probable cause to believe that:
(.1) a person poses a risk of imminent personal injury to himself or herself or other individuals,
(.2) such person possesses one or more firearms, and
(.3) such firearm or firearms are within or upon any place, thing or person located within the City of Philadelphia,
such judge may issue a warrant commanding a proper officer to enter into or upon such place or thing, search the same or person and take into such officer's custody any and all firearms. Such commonwealth's attorney or police officers shall not make such complaint unless such commonwealth's attorney or police officers have conducted an independent investigation and have determined that such probable cause exists and that there is not a reasonable alternative available to prevent such person from causing imminent personal injury to himself or herself or to others with such firearm.
(b) A warrant may be issued only on affidavit sworn by the complainant or complainants before the judge and establishing the grounds for issue the warrant, which affidavit shall be part of the temporary removal file. In determining whether good grounds for the application exists or whether there is probable cause to believe they exist, the judge shall consider:
(.1) recent threats or acts of violence by such person directed toward other person or persons,
(.2) recent threats or acts of violence by such person directed toward himself or herself, and
(.3) recent acts of cruelty to animals as provided in 18 Pa. C.S. § 5511 by such person.
(c) In evaluating whether such recent threats or acts of violence constitute probable cause to believe that such person poses a risk of imminent personal injury to himself or herself or others, the judge may consider other factors, including, but not limited to:
(.1) the reckless use, display or brandishing of a firearm by such person,
(.2) a history of the use, attempted or threatened use of physical force by such person against another person, and
(.3) the illegal use of controlled substances or abuse of alcohol, by such person.
If the judge is satisfied that the grounds for the application exists or that there is probable cause to believe that they exist, such judge shall issue a warrant naming or describing the person, place or thing to be searched. The warrant shall be directed to any police officer of a regularly organized police department within the City of Philadelphia. It shall state the grounds or probable cause for its issuance and it shall command the officer to search within a reasonable time the person, place or thing named for any and all firearms. A copy of the warrant shall be given to the person named therein together with a notice informing the person that such person has the right to a hearing under this Section and the right to be represented by counsel at such hearing.
(d) The applicant for the warrant shall file a copy of the application for a warrant and all affidavits upon which the warrant is based with the Court of Common Pleas for Philadelphia County no later than the next business day following the execution of the warrant. Prior to execution of the warrant, the court shall not disclose any information pertaining to the application for the warrant or any affidavits upon which the warrant is based. The warrant shall be executed and returned with reasonable promptness consistent with due process of law and shall be accompanied by a written inventory of all firearms temporarily removed.
(e) Not later than seven days after the execution of a warrant under this Section, the Court of Common Pleas of Philadelphia County shall hold a hearing to determine whether the temporarily removed firearms should be returned to the person named in the warrant or should continue to be held by the state. If, after such hearing, the court finds clear and convincing evidence that the person poses a risk of imminent personal injury to himself or herself or to other individuals, it may order that the firearm or firearms temporarily removed pursuant to the warrant issued under subsection (a) of this Section continue to be held by the Philadelphia Police Department until such time as the court finds the individual named in the warrant fit to possess the firearm or firearms which were temporarily removed from the individual's custody, otherwise the court shall order the temporarily removed firearm or firearms to be returned to the person named in the warrant. Notwithstanding any other provision, the Philadelphia Police Department may retain custody of the firearm for a period of not more than a year. Upon expiration of that time, the Philadelphia Police Department may return the firearm to the person named in the warrant, if deemed appropriate after a court hearing, or dispose of the firearm as deemed appropriate. If the court finds that the person poses a risk of imminent personal injury to himself or herself or to other individuals, it shall give notice to the Department of Mental Health, which may take such action pursuant to section 302, 303, or 304 of the provisions of the Act of July 9, 1976 (P.L. 817, No. 143), known as the Mental Health Procedure Act as it deems appropriate.
(f) Any person whose firearms have been ordered temporarily removed pursuant to subsection (d) of this Section, or such person's legal representative, may transfer such firearm or firearms in accordance with this provision of 18 Pa. C.S. § 6111 or other applicable state or federal law, to any person eligible to possess such firearm or firearms. Upon notification in writing by such person, or such person's legal representative, and the transferee, the Commissioner of the Philadelphia Police Department shall within ten days deliver such firearm or firearms to the transferee.