Code improved removed duplicate code
Code improved removed duplicate code

adding validateComponent method
refactoring removeSegment method
concrete5/url,mleko/url,FataliBud/url,localheinz/uri,thephpleague/uri-manipulations,thephpleague/url,mkly/url,KorvinSzanto/uri,thephpleague/uri-schemes,thephpleague/uri-parser,localheinz/url