Skip to content

Commit

Permalink
chore(cleanup): cleanup some code problems
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelAlphonso authored and mcaskill committed Mar 5, 2024
1 parent 47c1ae0 commit b4af3bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function displayTemplate()
{
$display = $this->display();

return 'charcoal/admin/widget/form-group/structure/container-' . $display;
return 'charcoal/admin/widget/form-group/structure/container-'.$display;
}

/**
Expand Down Expand Up @@ -460,8 +460,7 @@ protected function findStructureFormGroup(): ?array

if (isset($struct['admin']['default_form_group'])) {
$groupName = $struct['admin']['default_form_group'];
if (
\is_string($groupName) &&
if (\is_string($groupName) &&
isset($struct['admin']['form_groups'][$groupName])
) {
return $struct['admin']['form_groups'][$groupName];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Charcoal\Property\StructureProperty;
use Charcoal\Property\Structure\StructureMetadata;
use Charcoal\Property\Structure\StructureModel;
// From 'charcoal-translator'
use Charcoal\Translator\Translation;

/**
* Model Structure Data Property
Expand Down Expand Up @@ -186,8 +188,7 @@ public function validateModelStructure(): bool
$result = true;

$model = $this->structureProto();
if (
!($model instanceof ModelInterface) ||
if (!($model instanceof ModelInterface) ||
!($model instanceof ValidatableInterface)
) {
return $result;
Expand Down Expand Up @@ -374,7 +375,7 @@ protected function loadStructureMetadata()

$structureKey = $structureInterfaces;
array_unshift($structureKey, $this->ident());
$structureKey = 'property/structure=' . $metadataLoader->serializeMetaKey($structureKey);
$structureKey = 'property/structure='.$metadataLoader->serializeMetaKey($structureKey);

$structureMetadata = $metadataLoader->load(
$structureKey,
Expand Down Expand Up @@ -453,7 +454,7 @@ protected function setStructureModelClass($className)
$this->structureModelType = $className;
$prototype = $this->structureModelFactory()->get($className);
$className = get_class($prototype);
} catch (Exception $e) {
} catch (\Exception $e) {
throw new InvalidArgumentException(sprintf(
'Invalid structure class name: %s',
$className
Expand Down

0 comments on commit b4af3bf

Please sign in to comment.