Rotating a layer and its sublayers:

$degrees = -17;

$layer->rotate($degrees);

What we get:

Be carefull, as you see, a rotation can enlarge your layer !