/** * @param Message $message * @return \AerialShip\LightSaml\Model\XmlDSig\SignatureCreator|null * @throws \RuntimeException */ private function getMessageSignature(Message $message) { $signature = $message->getSignature(); if ($signature && !$signature instanceof SignatureCreator) { throw new \RuntimeException('Signature must be SignatureCreator'); } return $signature; }