Skip to content

Commit

Permalink
Merge pull request #77 from survos/tac
Browse files Browse the repository at this point in the history
add php 8.4 compatibility, CI
  • Loading branch information
tacman authored Nov 29, 2024
2 parents c364314 + 3c02c26 commit 1b77257
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 14 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: phpstan-CI
on:
[push, pull_request]
jobs:
phpstan:
runs-on: ubuntu-latest
name: PHPStan
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- name: Checkout
uses: actions/checkout@v4
- name: composer install
run: composer install
- name: PHPStan
run: vendor/bin/phpstan
env:
REQUIRE_DEV: true
3 changes: 2 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
php-version:
- "8.2"
- "8.3"
- "8.4"
deps:
- "normal"
include:
Expand All @@ -21,7 +22,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/FormUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function typeAncestry(FormInterface $form)
*
* @return void
*/
public static function typeAncestryForType(array &$types, ResolvedFormTypeInterface $formType = null): void
public static function typeAncestryForType(array &$types, ?ResolvedFormTypeInterface $formType = null): void
{
if (!($formType instanceof ResolvedFormTypeInterface)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Resolver implements ResolverInterface
* @param TransformerInterface $transformer
* @param string|null $widget
*/
public function setTransformer($formType, TransformerInterface $transformer, $widget = null): void
public function setTransformer($formType, TransformerInterface $transformer, ?string $widget = null): void
{
$this->transformers[$formType] = [
'transformer' => $transformer,
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/ResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface ResolverInterface
* @param TransformerInterface $transformer
* @param string|null $widget
*/
public function setTransformer($formType, TransformerInterface $transformer, $widget = null);
public function setTransformer($formType, TransformerInterface $transformer, ?string $widget = null);

/**
* @param FormInterface $form
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Transformer/AbstractTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function applyExtensions(array $extensions, FormInterface $form, array
*
* @return array
*/
protected function addCommonSpecs(FormInterface $form, array $schema, array $extensions = [], $widget = null)
protected function addCommonSpecs(FormInterface $form, array $schema, array $extensions = [], ?string $widget = null)
{
$schema = $this->addLabel($form, $schema);
$schema = $this->addAttr($form, $schema);
Expand Down
4 changes: 2 additions & 2 deletions src/Limenius/Liform/Transformer/ArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ArrayTransformer extends AbstractTransformer
* @param FormTypeGuesserInterface|null $validatorGuesser
* @param ResolverInterface $resolver
*/
public function __construct(TranslatorInterface $translator, ResolverInterface $resolver, FormTypeGuesserInterface $validatorGuesser = null)
public function __construct(TranslatorInterface $translator, ResolverInterface $resolver, ?FormTypeGuesserInterface $validatorGuesser = null)
{
parent::__construct($translator, $validatorGuesser);
$this->resolver = $resolver;
Expand All @@ -41,7 +41,7 @@ public function __construct(TranslatorInterface $translator, ResolverInterface $
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$children = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Transformer/BooleanTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BooleanTransformer extends AbstractTransformer
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$schema = ['type' => 'boolean'];
$schema = $this->addCommonSpecs($form, $schema, $extensions, $widget);
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Transformer/ChoiceTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ChoiceTransformer extends AbstractTransformer
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$formView = $form->createView();

Expand Down
4 changes: 2 additions & 2 deletions src/Limenius/Liform/Transformer/CompoundTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CompoundTransformer extends AbstractTransformer
* @param ResolverInterface $resolver
* @param FormTypeGuesserInterface|null $validatorGuesser
*/
public function __construct(TranslatorInterface $translator, ResolverInterface $resolver, FormTypeGuesserInterface $validatorGuesser = null)
public function __construct(TranslatorInterface $translator, ResolverInterface $resolver, ?FormTypeGuesserInterface $validatorGuesser = null)
{
parent::__construct($translator, $validatorGuesser);
$this->resolver = $resolver;
Expand All @@ -40,7 +40,7 @@ public function __construct(TranslatorInterface $translator, ResolverInterface $
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$data = [];
$order = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Transformer/IntegerTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IntegerTransformer extends AbstractTransformer
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$schema = ['type' => 'integer'];
$schema = $this->addCommonSpecs($form, $schema, $extensions, $widget);
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Transformer/NumberTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NumberTransformer extends AbstractTransformer
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$schema = ['type' => 'number'];
$schema = $this->addCommonSpecs($form, $schema, $extensions, $widget);
Expand Down
2 changes: 1 addition & 1 deletion src/Limenius/Liform/Transformer/StringTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class StringTransformer extends AbstractTransformer
/**
* {@inheritdoc}
*/
public function transform(FormInterface $form, array $extensions = [], $widget = null): array
public function transform(FormInterface $form, array $extensions = [], ?string $widget = null): array
{
$schema = ['type' => 'string'];
$schema = $this->addCommonSpecs($form, $schema, $extensions, $widget);
Expand Down

0 comments on commit 1b77257

Please sign in to comment.