It's so obvious, during his chilhood, Phoenix saw the good in the seriousness Edgeworth had, plus the fact that Miles defended him when everyone was accusing him of stealing, which we all know helped Phoenix decide to study law one way or another. He saw how Edgeworth defended him(which funny enough Edgeworth then becomes the opposite), and was in awe, because he saw that there was hope in helpless situations like his, and that he should always look for justice, even if everything points to a bad ending, which we see Wright adapt in the way he worked as a defence attorney in the future. Similarly, when Phoenix came across his long lost friend's name , he looked past the scary prosecutor Miles had become because of his trauma and the way he was raised, and decided to find him in any way possible.
In the Ace Attorney anime, we also see young Phoenix becomeworried for his friend's disappearance, and with enough tries, (without his knowledge unfortunaly for him), he reaches Edgeworth, through their favorite show, which, for a split second , we see the silver haired boy, (who is mid you, grieving),think about the life he left behind, showing how close Phoenix, Miles and even Larry had grown together in school.
Though, of course, Miles didn't do anything to reach his friend, as Von Karma had him under his wing at the time, after the events of his father's murder, which left him scarred , and almost questioning whether there is any hope believing in justice, hense why he went on to become an "unbeatable" prosecutor eveyone feared of going against.
Going back to the events of the game, after Phoenix succesfully broke Edgeworth's winning streak, Gumshoe mentions that the prosecutor is furious and "Broke one of the plastic cups of coffee." after the trial came to an end. In the trial itself , we saw how confident Miles was with his statements, fighting constantly to prove anything Wright said false, going as far as to (intentionally) not inform the attorney about the autopsy report that was updated, but maybe, truly, that could have been a simple white lie he used to get Phoenix to give up. In the end of the trial, where Mr.White is found guilty, Edgeworth looks ready to jump over the desk and tackle Phoenix, utterly speachless at the loss. Over the course of the game though, and especially after he was the one who had to take the stand and try to prove his innocence, he seemed to be able to cooperate more comfortably with his childhood friend, more willing, even if driven by immense guild, trauma-ridden during his stay in detention, in the end he was shocked when he and Phoenix together found out who was guilty for his father's death, easing him of his guilt, and even helping the poor man try to socialize more, not that he was the best at it.
Ergo, those two are definitely gay.