Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Don't use keyword "self" #410

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ENH Don't use keyword "self"
  • Loading branch information
GuySartorelli committed Aug 1, 2024
commit 7d2460c85f26a7d4c8d15a2eaf8380c4838b34d0
22 changes: 11 additions & 11 deletions src/GridFieldNestedForm.php
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements
GridField_DataManipulator
{
use Configurable, GridFieldStateAware;

/**
* The key used in the post data to identify nested form data
*/
@@ -55,7 +55,7 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements
* The default max nesting level. Nesting further than this will throw an exception.
*/
private static int $default_max_nesting_level = 10;

private string $name;

private bool $expandNested = false;
@@ -74,12 +74,12 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements
private $canExpandCallback = null;

private int $maxNestingLevel = 0;

public function __construct($name = 'NestedForm')
{
$this->name = $name;
}

/**
* Get the grid field that this component is attached to
*/
@@ -95,7 +95,7 @@ public function getRelationName(): string
{
return $this->relationName;
}

/**
* Set the relation name to use for the nested grid fields
*/
@@ -121,7 +121,7 @@ public function setInlineEditable(bool $editable): static
$this->inlineEditable = $editable;
return $this;
}

/**
* Set whether the nested grid fields should be expanded by default
*/
@@ -255,7 +255,7 @@ public function getColumnContent($gridField, $record, $columnName)
])->renderWith('Symbiote\GridFieldExtensions\GridFieldNestedForm');
}
}

public function getURLHandlers($gridField)
{
return [
@@ -349,7 +349,7 @@ public function handleMoveToParent(GridField $gridField, $request): string
}
return $gridField->FieldHolder();
}

/**
* Handle the request to show a nested item
*/
@@ -424,7 +424,7 @@ public function toggleNestedItem(
$stateRelation = $className.'-'.$record->ID.'-'.$this->getRelationName();
$state->$stateRelation = (int)$request->getVar('toggle');
}

/**
* Get the link for the nested grid field
*/
@@ -444,10 +444,10 @@ public function ToggleLink($action = null): string
$manager = $this->getStateManager();
return $manager->addStateToURL($this->gridField, $link);
}

public function handleSave(GridField $gridField, DataObjectInterface $record)
{
$postKey = self::POST_KEY;
$postKey = GridFieldNestedForm::POST_KEY;
$value = $gridField->Value();
if (isset($value['GridState']) && $value['GridState']) {
// set grid state from value, to store open/closed toggle state for nested forms
Loading