The Kensington junkyard that was the scene of a spectacular fire last month will have to remain closed until it resolves multiple code violations, a judge ruled Thursday.

Rejecting a request by Philadelphia Metal & Resource Recovery to reopen its junkyard at Tulip and Somerset Streets, Common Pleas Court Judge Paula A. Patrick gave owner David Feinberg a week to prepare for an inspection by the Department of Licenses and Inspections.

If it fails, the junkyard will have to stay shut until it complies. If needed, the Aug. 30 hearing scheduled before the blaze happened will go forward.

The junkyard caught fire on July 10 but reopened a week later. L&I ordered it closed on July 25 after inspectors visited the property and gave Feinberg three hours to fix violations, which included a lack of fire lanes between scrap piles.

That demand was unreasonable, said Feinberg's attorney, Darlene Threatt, who said Feinberg has "diligently been working to clear these violations."

"These violations are punitive in nature and are aimed at shutting my client down permanently, not aimed at protecting the health, safety, and welfare of the community," Threatt said.

She said that it would take at least 30 days to get the junkyard into compliance and that its 30 employees wouldn't be paid in the meantime.

City attorney Edward Jefferson said the absence of fire lanes inhibited firefighters who were battling the blaze. One firefighter was injured.

L&I has cited the junkyard 71 times in the last 10 years for violations including "mislabeled storage containers" and an "excessive collection of tires," according to public records.

"The key [to reopening] is totally in [Feinberg's] hand, and it's been in his hand the whole time," Jefferson said.

Threatt pointed out that Feinberg had owned the yard only since 2016, but the judge said "he was aware of the certain violations" and didn't try to fix them.