GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix PHP warnings when building an incomplete CASE expression · phpmyadmin/sql-parser@b47e27b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/Components
    • CaseExpression.php
  • tests
    • Components
      • CaseExpressionTest.php
    • data/parser
      • parseSelectCase1.out
      • parseSelectCase2.out
      • parseSelectCase3.out
      • parseSelectCase4.out
      • parseSelectCaseAlias1.out
      • parseSelectCaseAlias2.out
      • parseSelectCaseAlias5.out
      • parseSelectCaseAlias6.out
      • parseSelectCaseAliasErr1.out
      • parseSelectCaseAliasErr2.out
      • parseSelectCaseAliasErr3.out
      • parseSelectCaseAliasErr4.out
      • parseSelectCaseErr1.out
      • parseSelectCaseErr2.out
      • parseSelectCaseErr3.out
      • parseSelectCaseErr4.out
      • parseSelectCaseErr5.out
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Components/CaseExpression.php‎

Copy file name to clipboardExpand all lines: src/Components/CaseExpression.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ class CaseExpression extends Component
3333
*
3434
* @var array
3535
*/
36-
public $conditions;
36+
public $conditions = [];
3737

3838
/**
3939
* The results matching with the WHEN clauses.
4040
*
4141
* @var array
4242
*/
43-
public $results;
43+
public $results = [];
4444

4545
/**
4646
* The values to be compared against.
4747
*
4848
* @var array
4949
*/
50-
public $compare_values;
50+
public $compare_values = [];
5151

5252
/**
5353
* The result in ELSE section of expr.
Collapse file

‎tests/Components/CaseExpressionTest.php‎

Copy file name to clipboardExpand all lines: tests/Components/CaseExpressionTest.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,10 @@ public function testParseBuild8()
118118
'CASE WHEN 1=1 THEN "Some" WHEN 1=2 THEN "SomeOther" END AS `foo`'
119119
);
120120
}
121+
122+
public function testBuildWithIncompleteCaseExpression()
123+
{
124+
$incomplete_case_expression_component = new CaseExpression();
125+
$this->assertEquals('CASE END', CaseExpression::build($incomplete_case_expression_component));
126+
}
121127
}
Collapse file

‎tests/data/parser/parseSelectCase1.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCase1.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCase2.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCase2.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCase3.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCase3.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCase4.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCase4.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCaseAlias1.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCaseAlias1.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCaseAlias2.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCaseAlias2.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCaseAlias5.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCaseAlias5.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Collapse file

‎tests/data/parser/parseSelectCaseAlias6.out‎

Copy file name to clipboardExpand all lines: tests/data/parser/parseSelectCaseAlias6.out
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.