add license to composer.json
add InvalidStateException