Skip to content

Commit 025a260

Browse files
authored
Merge pull request #147 from AniLeo/master
Miscellaneous static analysis fixes, remove duplicated download logic from Quickstart, add phpstan CI workflow
2 parents 1dc8b69 + 635fb54 commit 025a260

6 files changed

Lines changed: 66 additions & 348 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: CI
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the master branch
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
# This workflow contains a single job called "build"
18+
build:
19+
# The type of runner that the job will run on
20+
runs-on: ubuntu-latest
21+
22+
# Steps represent a sequence of tasks that will be executed as part of the job
23+
steps:
24+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25+
- uses: actions/checkout@v4
26+
27+
# Run PHPStan level 3 analysis
28+
- name: PHPStan Static Analysis
29+
uses: php-actions/phpstan@v3
30+
with:
31+
version: latest
32+
php-version: latest
33+
path: .
34+
level: 3
35+
memory_limit: 256M

public_html/lib/module/download/inc-download-platform.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div class='sha2-ico-desc' style="background: url(/img/icons/buttons/sha2-arm64.png) center / contain no-repeat;"></div>
3434
<span>
3535
<?php
36-
if (false /*isset($build) && !is_null($build->checksum_win_arm64)*/)
36+
if (isset($build) && !is_null($build->checksum_win_arm64) && false) // Disabled
3737
printf("%s", $build->checksum_win_arm64);
3838
else if (isset($build_windows_arm64))
3939
printf("%s", $build_windows_arm64->checksum_win_arm64);
@@ -82,7 +82,7 @@
8282
printf("</a>");
8383
?>
8484
<?php
85-
if (false /*isset($build) && !is_null($build->get_url_windows_arm64())*/)
85+
if (isset($build) && !is_null($build->get_url_windows_arm64()) && false) // Disabled
8686
printf("<a href=\"%s\" download>", $build->get_url_windows_arm64());
8787
else if (isset($build_windows_arm64))
8888
printf("<a href=\"%s\" download>", $build_windows_arm64->get_url_windows_arm64());
@@ -93,7 +93,7 @@
9393
<div class='package-con-metabutton'>
9494
<span class='package-tx1-metabutton'>
9595
<?php
96-
if (false /*isset($build) && !is_null($build->get_url_windows_arm64())*/)
96+
if (isset($build) && !is_null($build->get_url_windows_arm64()) && false) // Disabled
9797
printf("Download for arm64");
9898
else
9999
printf("Coming soon...");
@@ -102,7 +102,7 @@
102102
<br>
103103
<span class='package-tx2-metabutton'>
104104
<?php
105-
if (false /*isset($build) && !is_null($build->get_size_mb_windows_arm64())*/)
105+
if (isset($build) && !is_null($build->get_size_mb_windows_arm64()) && false) // Disabled
106106
printf("%s MB", $build->get_size_mb_windows_arm64());
107107
else
108108
printf("");
@@ -111,7 +111,7 @@
111111
</div>
112112
</div>
113113
<?php
114-
if (false /*isset($build) && !is_null($build->get_url_windows_arm64())*/)
114+
if (isset($build) && !is_null($build->get_url_windows_arm64()) && false) // Disabled
115115
printf("</a>");
116116
?>
117117
</div>

public_html/lib/module/menu/inc-menu-blog.php

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,31 @@
99
<header id="masthead" class="site-header" role="banner">
1010
<div class="site-branding">
1111
<?php
12-
twentyfifteen_the_custom_logo();
13-
if ( is_front_page() && is_home() ) : ?>
14-
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
15-
<?php else : ?>
16-
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
17-
<?php endif;
18-
$description = get_bloginfo( 'description', 'display' );
19-
if ( $description || is_customize_preview() ) : ?>
20-
<p class="site-description"><?php echo $description; ?></p>
21-
<?php endif;
12+
if (function_exists("twentyfifteen_the_custom_logo") &&
13+
function_exists("is_front_page") &&
14+
function_exists("is_home") &&
15+
function_exists("esc_url") &&
16+
function_exists("home_url") &&
17+
function_exists("bloginfo") &&
18+
function_exists("get_bloginfo") &&
19+
function_exists("is_customize_preview"))
20+
{
21+
twentyfifteen_the_custom_logo();
22+
if ( is_front_page() && is_home() ) : ?>
23+
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
24+
<?php else : ?>
25+
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
26+
<?php endif;
27+
$description = get_bloginfo( 'description', 'display' );
28+
if ( $description || is_customize_preview() ) : ?>
29+
<p class="site-description"><?php echo $description; ?></p>
30+
<?php endif;
31+
}
2232
?>
23-
<button class="secondary-toggle"><?php _e( 'Menu and widgets', 'RPCS3' ); ?></button>
33+
<button class="secondary-toggle"><?php if (function_exists("_e")) _e( 'Menu and widgets', 'RPCS3' ); ?></button>
2434
</div>
2535
</header>
26-
<?php get_sidebar(); ?>
36+
<?php if (function_exists("get_sidebar")) get_sidebar(); ?>
2737
</div>
2838
</div>
2939
</div>

0 commit comments

Comments
 (0)