Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @final annotation to Components classes #362

Merged
merged 1 commit into from Nov 25, 2021

Conversation

MauricioFauth
Copy link
Member

Since there is no reason to extend the PhpMyAdmin\SqlParser\Components classes, this pull request adds the @final annotation to these classes. This removes the unsafe instantiation errors reported by PHPStan and Psalm.

The @final annotation should be replaced with the final keyword in the next major version.

Fixes #271.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@MauricioFauth MauricioFauth self-assigned this Nov 25, 2021
@MauricioFauth MauricioFauth added this to the 5.5.0 milestone Nov 25, 2021
@codecov
Copy link

codecov bot commented Nov 25, 2021

Codecov Report

Merging #362 (072143a) into master (f45b16c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #362   +/-   ##
=========================================
  Coverage     95.41%   95.41%           
  Complexity     2024     2024           
=========================================
  Files            67       67           
  Lines          4336     4336           
=========================================
  Hits           4137     4137           
  Misses          199      199           
Impacted Files Coverage Δ
src/Components/AlterOperation.php 100.00% <ø> (ø)
src/Components/Array2d.php 100.00% <ø> (ø)
src/Components/ArrayObj.php 100.00% <ø> (ø)
src/Components/CaseExpression.php 100.00% <ø> (ø)
src/Components/Condition.php 100.00% <ø> (ø)
src/Components/CreateDefinition.php 100.00% <ø> (ø)
src/Components/DataType.php 100.00% <ø> (ø)
src/Components/Expression.php 100.00% <ø> (ø)
src/Components/ExpressionArray.php 100.00% <ø> (ø)
src/Components/FunctionCall.php 100.00% <ø> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f45b16c...072143a. Read the comment docs.

@MauricioFauth MauricioFauth merged commit c78df57 into phpmyadmin:master Nov 25, 2021
@MauricioFauth MauricioFauth deleted the components-final branch November 25, 2021 23:06
MauricioFauth added a commit that referenced this pull request Jan 3, 2022
Related to #271 and #362.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsafe usage of new static()
2 participants