Skip to content

Commit

Permalink
Settings page (#1)
Browse files Browse the repository at this point in the history
* fix: changed status codes

* fix: changed constructor in settingspage
  • Loading branch information
caseyreuter authored May 19, 2023
1 parent 0ec76e3 commit 061c2c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions admin/src/SettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

class SettingsPage
{
public function __construct( private readonly string $file_name )
private $file_name;

public function __construct( string $file_name )
{
$this->file_name = $file_name;
add_action( 'admin_menu', [ $this, 'admin_menu' ], 1000 );
add_action( 'admin_post_cpm_settings', [ $this, 'admin_post_cpm_settings' ] );
add_action( 'admin_post_nopriv_cpm_settings', [ $this, 'admin_post_cpm_settings' ] );
Expand Down Expand Up @@ -76,7 +79,7 @@ public final function settingsPage(): void
?>
<tr>
<td><?= $name; ?></td>
<td><?= ( ! empty( $respons ) ? 'connected' : 'disconnected' ); ?></td>
<td><?= ( ! empty( $respons ) && is_array( $respons ) ? 'connected' : ( ! empty( $respons ) ? $respons : 'no release found' ) ); ?></td>
</tr>
<?php } ?>
</tbody>
Expand Down

0 comments on commit 061c2c9

Please sign in to comment.