diff --git a/composer.json b/composer.json index b20f89859..bf8045353 100644 --- a/composer.json +++ b/composer.json @@ -38,8 +38,9 @@ "assetic/framework": "^3.2.2", "doctrine/dbal": "^3.0", "enshrined/svg-sanitize": "~0.16", - "laravel/framework": "^12.30.1", - "laravel/tinker": "^2.8.1", + "laravel/framework": "^12.30.1|^13.0", + "laravel/tinker": "^2.8.1|^3.0", + "league/commonmark": "^2.10.2", "league/csv": "~9.1", "nesbot/carbon": "^3.0", "scssphp/scssphp": "~1.0", @@ -58,13 +59,14 @@ "meyfa/phpunit-assert-gd": "^4.2", "mockery/mockery": "^1.6|^2.0", "dms/phpunit-arraysubset-asserts": "dev-add-phpunit-11-support", - "orchestra/testbench": "^10.0", + "orchestra/testbench": "^10.0|^11.0", "larastan/larastan": "^3.6.0" }, "repositories": [ { "type": "vcs", - "url": "https://github.com/pieterocp/phpunit-arraysubset-asserts" + "url": "https://github.com/pieterocp/phpunit-arraysubset-asserts", + "no-api": true } ], "suggest": { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 37a96bd59..6f5c3bb23 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1021,7 +1021,7 @@ parameters: path: src/Support/Testing/Fakes/MailFake.php - - message: '#^Parameter \#2 \$data \(array\) of method Winter\\Storm\\Support\\Testing\\Fakes\\MailFake\:\:queue\(\) should be compatible with parameter \$queue \(string\|null\) of method Illuminate\\Support\\Testing\\Fakes\\MailFake\:\:queue\(\)$#' + message: '#^Parameter \#2 \$data \(array\) of method Winter\\Storm\\Support\\Testing\\Fakes\\MailFake\:\:queue\(\) should be compatible with parameter \$queue \((BackedEnum\|)?string\|null\) of method Illuminate\\Support\\Testing\\Fakes\\MailFake\:\:queue\(\)$#' identifier: method.childParameterType count: 1 path: src/Support/Testing/Fakes/MailFake.php diff --git a/src/Database/Traits/ArraySource.php b/src/Database/Traits/ArraySource.php index 1c9e09fe7..690e1c6e6 100644 --- a/src/Database/Traits/ArraySource.php +++ b/src/Database/Traits/ArraySource.php @@ -29,7 +29,7 @@ trait ArraySource /** * Connection. to the SQLite datasource. */ - protected static \Illuminate\Database\Connection $arraySourceConnection; + protected static ?\Illuminate\Database\Connection $arraySourceConnection = null; /** * Boots the ArraySource trait. @@ -40,6 +40,17 @@ public static function bootArraySource(): void throw new ApplicationException('You must enable the SQLite PDO driver to use the ArraySource trait'); } + static::$arraySourceConnection = null; + } + + /** + * Creates the temporary SQLite datasource for this model. + * + * Laravel 13 throws a LogicException when a model is instantiated while it is booting, so this runs the first + * time the connection is resolved instead of in `bootArraySource()`. + */ + protected static function arraySourceBootConnection(): void + { $instance = new static; static::arraySourceSetDbConnection( @@ -79,6 +90,10 @@ public function getRecords() */ public static function resolveConnection($connection = null) { + if (static::$arraySourceConnection === null) { + static::arraySourceBootConnection(); + } + return static::$arraySourceConnection; } diff --git a/tests/fixtures/markdown/simple_table.html b/tests/fixtures/markdown/simple_table.html index c42ff60aa..241772bc8 100644 --- a/tests/fixtures/markdown/simple_table.html +++ b/tests/fixtures/markdown/simple_table.html @@ -43,7 +43,22 @@
Not a table.header 1:-------cell 1.1cell 2.1
Not a table.header 1-------|cell 1.1cell 2.1
+Is a table.
+| header 1 | +
|---|
| cell 1.1 | +
| cell 2.1 | +
Is a table.