Skip to content

Commit

Permalink
Fix for lint & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skarya22 committed Dec 3, 2024
1 parent 6fa5e09 commit 6217797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions php/libraries/NDB_Page.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class NDB_Page extends \LORIS\Http\Endpoint implements RequestHandlerInterface
* The default dateOptions to send to LorisForm to render elements
* on this page. This is usually set by subclasses of NDB_Page which
* need to modify the options to show on a date (ie. min year, max year,
* etc.). Default values can be added here, which can be overriden.g
* etc.). Default values can be added here, which can be overriden.
*
* @var array
*/
Expand Down Expand Up @@ -311,13 +311,13 @@ class NDB_Page extends \LORIS\Http\Endpoint implements RequestHandlerInterface
function addBasicDate(
$field,
$label,
$options=[],
$options,
$attribs=[
'class' => 'form-control input-sm',
'style' => 'max-width:33%; display:inline-block;',
]
) {
$options = $options + $this->dateOptions;
$options = ($options ?? []) + $this->dateOptions;
$this->form->addElement('date', $field, $label, $options, $attribs);
}

Expand Down Expand Up @@ -592,7 +592,7 @@ class NDB_Page extends \LORIS\Http\Endpoint implements RequestHandlerInterface
function createDate(
$field,
$label,
$dateOptions=[],
$dateOptions,
$attribs=[
'class' => 'form-control input-sm',
'style' => 'max-width:33%; display:inline-block;',
Expand All @@ -602,7 +602,7 @@ class NDB_Page extends \LORIS\Http\Endpoint implements RequestHandlerInterface
"date",
$field,
$label,
$dateOptions + $this->dateOptions,
($dateOptions ?? []) + $this->dateOptions,
$attribs
);
}
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/NDB_PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function testAddBasicTextArea()
/**
* Test that addBasicDate calls addElement from LorisForm and properly adds
* an element to the page's form when dateOptions is not set. Since
* dateOptions is not set, the options array should just have the default maxYear.
* dateOptions is not set, the options array should have the default maxYear.
*
* @covers NDB_Page::addBasicDate
* @return void
Expand Down

0 comments on commit 6217797

Please sign in to comment.