Various code cleanup.

This commit is contained in:
James Cole
2021-04-06 17:00:16 +02:00
parent 8572280b7b
commit 38d0f0427f
61 changed files with 419 additions and 369 deletions

View File

@@ -64,7 +64,7 @@ class ExpandedForm
}
try {
$html = prefixView('form.amount-no-currency', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::error(sprintf('Could not render amountNoCurrency(): %s', $e->getMessage()));
$html = 'Could not render amountNoCurrency.';
}
@@ -100,7 +100,7 @@ class ExpandedForm
unset($options['placeholder'], $options['autocomplete'], $options['class']);
try {
$html = prefixView('form.checkbox', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render checkbox(): %s', $e->getMessage()));
$html = 'Could not render checkbox.';
}
@@ -125,7 +125,7 @@ class ExpandedForm
unset($options['placeholder']);
try {
$html = prefixView('form.date', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render date(): %s', $e->getMessage()));
$html = 'Could not render date.';
}
@@ -148,7 +148,7 @@ class ExpandedForm
$classes = $this->getHolderClasses($name);
try {
$html = prefixView('form.file', compact('classes', 'name', 'label', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render file(): %s', $e->getMessage()));
$html = 'Could not render file.';
}
@@ -174,7 +174,7 @@ class ExpandedForm
$options['step'] = '1';
try {
$html = prefixView('form.integer', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render integer(): %s', $e->getMessage()));
$html = 'Could not render integer.';
}
@@ -199,7 +199,7 @@ class ExpandedForm
$value = $this->fillFieldValue($name, $value);
try {
$html = prefixView('form.location', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render location(): %s', $e->getMessage()));
$html = 'Could not render location.';
}
@@ -220,12 +220,12 @@ class ExpandedForm
$fields = ['title', 'name', 'description'];
/** @var Eloquent $entry */
foreach ($set as $entry) {
$entryId = (int)$entry->id;
$entryId = (int)$entry->id; // @phpstan-ignore-line
$title = null;
foreach ($fields as $field) {
if (isset($entry->$field) && null === $title) {
$title = $entry->$field;
if (property_exists($entry, $field) && null === $title) {
$title = $entry->$field; // @phpstan-ignore-line
}
}
$selectList[$entryId] = $title;
@@ -257,7 +257,7 @@ class ExpandedForm
}
try {
$html = prefixView('form.non-selectable-amount', compact('selectedCurrency', 'classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render nonSelectableAmount(): %s', $e->getMessage()));
$html = 'Could not render nonSelectableAmount.';
}
@@ -283,7 +283,7 @@ class ExpandedForm
unset($options['placeholder']);
try {
$html = prefixView('form.number', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render number(): %s', $e->getMessage()));
$html = 'Could not render number.';
}
@@ -312,7 +312,7 @@ class ExpandedForm
try {
$html = prefixView('form.object_group', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render objectGroup(): %s', $e->getMessage()));
$html = 'Could not render objectGroup.';
}
@@ -331,7 +331,7 @@ class ExpandedForm
{
try {
$html = prefixView('form.options', compact('type', 'name'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render select(): %s', $e->getMessage()));
$html = 'Could not render optionsList.';
}
@@ -354,7 +354,7 @@ class ExpandedForm
$classes = $this->getHolderClasses($name);
try {
$html = prefixView('form.password', compact('classes', 'name', 'label', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render password(): %s', $e->getMessage()));
$html = 'Could not render password.';
}
@@ -382,7 +382,7 @@ class ExpandedForm
unset($options['placeholder']);
try {
$html = prefixView('form.percentage', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render percentage(): %s', $e->getMessage()));
$html = 'Could not render percentage.';
}
@@ -405,7 +405,7 @@ class ExpandedForm
$classes = $this->getHolderClasses($name);
try {
$html = prefixView('form.static', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render staticText(): %s', $e->getMessage()));
$html = 'Could not render staticText.';
}
@@ -429,7 +429,7 @@ class ExpandedForm
$value = $this->fillFieldValue($name, $value);
try {
$html = prefixView('form.text', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render text(): %s', $e->getMessage()));
$html = 'Could not render text.';
}
@@ -459,7 +459,7 @@ class ExpandedForm
try {
$html = prefixView('form.textarea', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render textarea(): %s', $e->getMessage()));
$html = 'Could not render textarea.';
}