1313
1414namespace League \CommonMark \Extension \TableOfContents ;
1515
16- use InvalidArgumentException ;
1716use League \CommonMark \Event \DocumentParsedEvent ;
17+ use League \CommonMark \Exception \InvalidArgumentException ;
1818use League \CommonMark \Extension \CommonMark \Node \Block \Heading ;
1919use League \CommonMark \Extension \HeadingPermalink \HeadingPermalink ;
2020use League \CommonMark \Extension \TableOfContents \Node \TableOfContents ;
@@ -82,11 +82,10 @@ public function onDocumentParsed(DocumentParsedEvent $event): void
8282 * @psalm-param TableOfContents|TableOfContentsWrapper $toc
8383 *
8484 * @phpstan-param TableOfContents|TableOfContentsWrapper $toc
85- *
86- * @throws InvalidArgumentException
8785 */
8886 private function insertBeforeFirstLinkedHeading (Document $ document , AbstractBlock $ toc ): void
8987 {
88+ // @phpstan-ignore booleanAnd.alwaysFalse
9089 if (! $ toc instanceof TableOfContents && ! $ toc instanceof TableOfContentsWrapper) {
9190 throw new InvalidArgumentException (
9291 'Toc should be a TableOfContents or TableOfContentsWrapper, got ' . \get_class ($ toc )
@@ -112,11 +111,10 @@ private function insertBeforeFirstLinkedHeading(Document $document, AbstractBloc
112111 * @psalm-param TableOfContents|TableOfContentsWrapper $toc
113112 *
114113 * @phpstan-param TableOfContents|TableOfContentsWrapper $toc
115- *
116- * @throws InvalidArgumentException
117114 */
118115 private function replacePlaceholders (Document $ document , AbstractBlock $ toc ): void
119116 {
117+ // @phpstan-ignore booleanAnd.alwaysFalse
120118 if (! $ toc instanceof TableOfContents && ! $ toc instanceof TableOfContentsWrapper) {
121119 throw new InvalidArgumentException (
122120 'Toc should be a TableOfContents or TableOfContentsWrapper, got ' . \get_class ($ toc )
0 commit comments