Skip to content

Commit

Permalink
More type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Apr 26, 2022
1 parent 94a5f38 commit 0189c6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 33 deletions.
4 changes: 1 addition & 3 deletions src/Form/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ class FormBuilder extends BaseFormBuilder
{
/**
* Array of locale keys.
*
* @var array
*/
protected $locales = [];
protected array $locales = [];

/**
* Sets the available locales for translatable fields.
Expand Down
41 changes: 11 additions & 30 deletions src/TranslatableBootForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,54 @@
namespace TypiCMS\LaravelTranslatableBootForms;

use Illuminate\Support\Str;
use TypiCMS\BootForms\BootForm;

class TranslatableBootForm
{
/**
* BootForm implementation.
*
* @var \TypiCMS\BootForms\BootForm
*/
protected $form;
protected BootForm $form;

/**
* Array holding config values.
*
* @var array
*/
protected $config;
protected array $config;

/**
* Array of locale keys.
*
* @var array
*/
protected $locales;
protected array $locales;

/**
* The current element type this class is working on.
*
* @var string
*/
protected $element = '';
protected string $element = '';

/**
* The array of arguments to pass in when creating the element.
*
* @var array
*/
protected $arguments = [];
protected array $arguments = [];

/**
* A keyed array of method => arguments to call on the created input.
*
* @var array
*/
protected $methods = [];
protected array $methods = [];

/**
* Boolean indicating if the element should be cloned with corresponding translation name attributes.
*
* @var bool
*/
protected $cloneElement = false;
protected bool $cloneElement = false;

/**
* Boolean indicating if the element should have an indication that is it a translation.
*
* @var bool
*/
protected $translatableIndicator = false;
protected bool $translatableIndicator = false;

/**
* Array holding the mappable element arguments.
*
* @var array
*/
private $mappableArguments = [
private array $mappableArguments = [
'text' => ['label', 'name', 'value'],
'textarea' => ['label', 'name'],
'password' => ['label', 'name'],
Expand All @@ -92,10 +75,8 @@ class TranslatableBootForm

/**
* Array holding the methods to call during element behavior processing.
*
* @var array
*/
private $elementBehaviors = [
private array $elementBehaviors = [
'text' => ['cloneElement', 'translatableIndicator'],
'textarea' => ['cloneElement', 'translatableIndicator'],
'password' => ['cloneElement', 'translatableIndicator'],
Expand Down

0 comments on commit 0189c6b

Please sign in to comment.