Skip to content

Commit

Permalink
fixing some messy recursion and phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Oct 8, 2024
1 parent c22b251 commit f61c048
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/factories/MatrixField.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public static function factory(): static
return MatrixFieldBlocks::factory();
}

throw new \RuntimeException('bad version');
throw new \RuntimeException('Craft Pest is not compatible with this version of Craft CMS.');
}
}
7 changes: 6 additions & 1 deletion src/factories/MatrixFieldBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@

use function markhuot\craftpest\helpers\base\version_greater_than_or_equal_to;

class MatrixFieldBlocks extends Field
class MatrixFieldBlocks extends MatrixField
{
protected $blockTypes = [];

public static function factory(): static
{
return new static;
}

public function blockTypes(...$blockTypes)
{
if (is_array($blockTypes[0])) {
Expand Down
7 changes: 6 additions & 1 deletion src/factories/MatrixFieldEntries.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

use craft\fields\Matrix;

class MatrixFieldEntries extends Field
class MatrixFieldEntries extends MatrixField
{
/**
* @var EntryType[]
*/
protected $entryTypes = [];

public static function factory(): static
{
return new static;
}

public function entryTypes(...$entryTypes)
{
if (is_array($entryTypes[0])) {
Expand Down

0 comments on commit f61c048

Please sign in to comment.