Skip to content

Typecast refactoring#288

Merged
darkdef merged 24 commits into
yiisoft:masterfrom
Tigrov:typecast_refactoring
Jul 16, 2023
Merged

Typecast refactoring#288
darkdef merged 24 commits into
yiisoft:masterfrom
Tigrov:typecast_refactoring

Conversation

@Tigrov

@Tigrov Tigrov commented Jul 4, 2023

Copy link
Copy Markdown
Member
Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues

@what-the-diff

what-the-diff Bot commented Jul 4, 2023

Copy link
Copy Markdown

PR Summary

  • Updated the .gitignore file
    The .gitignore file was revised. Specifically, we made sure it includes the /phpunit.xml file and does not include /phpunit.result.cache. This helps keep our repository clean and makes sure that only essential files are tracked for changes.

  • Refactored the dbTypecast and phpTypecastValue methods in the ColumnSchema.php file
    The coding techniques used within these two methods have been enhanced, utilizing the modern match expression in contrast with previous if-else and switch statements. This makes our code more readable, concise, and it can improve performance.

  • Updated the $typeMap array in the Schema.php file
    The mapping system to register our data types has been expanded by including key-value pairs for 'bit', 'bit varying', and 'varbit' types. This allows us to support more types of data in our application, thus enhancing versatility and compatibility.

  • Refactored the findColumns and loadColumnSchema methods in the Schema.php file
    These methods, crucial for interacting with database columns, are now utilizing the more efficient match expression as opposed to previous if-else statements. Similar to the ColumnSchema refactoring, this step improves our code's readability and efficiency.

  • Added the normalizeDefaultValue method in the Schema.php file
    A new function was implemented that adjusts the default value of a column based on the set PHP type. This addition assures consistency and better reliability when working with default values in our database columns.

@Tigrov

Tigrov commented Jul 6, 2023

Copy link
Copy Markdown
Member Author

Waiting for review of #287 to avoid conflicts

@Tigrov Tigrov closed this Jul 6, 2023
@Tigrov Tigrov reopened this Jul 10, 2023
@codecov

codecov Bot commented Jul 10, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 98.27% and project coverage change: -0.01 ⚠️

Comparison is base (e961047) 99.67% compared to head (add4688) 99.67%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #288      +/-   ##
============================================
- Coverage     99.67%   99.67%   -0.01%     
+ Complexity      212      203       -9     
============================================
  Files            13       13              
  Lines           619      609      -10     
============================================
- Hits            617      607      -10     
  Misses            2        2              
Impacted Files Coverage Δ
src/Schema.php 99.61% <97.14%> (-0.02%) ⬇️
src/ColumnSchema.php 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Tigrov Tigrov marked this pull request as ready for review July 10, 2023 03:46
Comment thread src/ColumnSchema.php
Comment thread src/Schema.php Outdated
Comment thread src/Schema.php Outdated
@Tigrov Tigrov requested a review from darkdef July 14, 2023 11:26
@darkdef darkdef requested review from samdark and terabytesoftw July 15, 2023 09:22
@darkdef darkdef merged commit 60e64e0 into yiisoft:master Jul 16, 2023
@darkdef

darkdef commented Jul 16, 2023

Copy link
Copy Markdown
Contributor

Great work. Thanks

@Tigrov Tigrov deleted the typecast_refactoring branch July 17, 2023 07:45
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.

4 participants