Remove unnecessary $schemaLink parameter

This commit is contained in:
Damian Mooyman 2016-10-21 11:11:18 +13:00
parent aa47845a6c
commit 7cd32b7d72
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
3 changed files with 4 additions and 6 deletions

View File

@ -17,10 +17,9 @@ class FormSchema {
* Gets the schema for this form as a nested array.
*
* @param Form $form
* @param string $schemaLink Link to get this schema
* @return array
*/
public function getSchema(Form $form, $schemaLink) {
public function getSchema(Form $form) {
$schema = [
'name' => $form->getName(),
'id' => $form->FormName(),

View File

@ -379,8 +379,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
$return = ['id' => $id];
if (in_array('schema', $schemaParts)) {
$schemaLink = $this->getSchemaLinkForForm($form);
$return['schema'] = $this->schema->getSchema($form, $schemaLink);
$return['schema'] = $this->schema->getSchema($form);
}
if (in_array('state', $schemaParts)) {

View File

@ -52,7 +52,7 @@ class FormSchemaTest extends SapphireTest {
'actions' => []
];
$schema = $formSchema->getSchema($form, 'admin/mysection/schema');
$schema = $formSchema->getSchema($form);
$this->assertInternalType('array', $schema);
$this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($schema));
}
@ -334,7 +334,7 @@ class FormSchemaTest extends SapphireTest {
]
];
$schema = $formSchema->getSchema($form, 'admin/mysection/schema');
$schema = $formSchema->getSchema($form);
$this->assertInternalType('array', $schema);
$this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($schema));