Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mackensen committed Feb 3, 2025
1 parent bd97cc4 commit 40c4c0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class provider implements
*
* @return string
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
10 changes: 5 additions & 5 deletions classes/writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ class writer extends \core\dataformat\base {
public $extension = ".md";

/** @var $columns Column headings for the data. */
private $columns = array();
private $columns = [];

/** @var $columnlength Stores the maximum found record length of each column. */
private $columnlength = array();
private $columnlength = [];

/** @var $flushed Whether the the preprocessed records have been flushed. */
private $flushed = 0;

/** @var $records Stores the records until they're flushed. */
private $records = array();
private $records = [];

/**
* Write the start of the format. The records will be flushed after column length is calculated.
Expand Down Expand Up @@ -106,7 +106,7 @@ public function write_footer($columns) {
*/
private function flush() {
$this->print_record($this->columns);
$separators = array();
$separators = [];
foreach ($this->columnlength as $key => $length) {
$separators[$key] = str_pad('', $length, '-');
}
Expand All @@ -123,7 +123,7 @@ private function flush() {
* @param array $record
*/
private function print_record($record) {
$values = array();
$values = [];
foreach ($this->columnlength as $key => $length) {
$values[] = str_pad($this->sanitize_record($record[$key]), $length);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/export_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
*/
class export_test extends \basic_testcase {
public function test_export() {
$fields = array('fruit', 'color');
$records = array(
array('Apple', 'red'),
array('Banana', 'yellow'),
array('Orange', 'orange')
);
$fields = ['fruit', 'color'];
$records = [
['Apple', 'red'],
['Banana', 'yellow'],
['Orange', 'orange']
];
$downloadrecords = new \ArrayObject($records);
$iterator = $downloadrecords->getIterator();

Expand Down

0 comments on commit 40c4c0d

Please sign in to comment.