alphazframework / framework

Core files of AlphaZ Framework
https://alphazframework.github.io/
MIT License
16 stars 17 forks source link

Add an adapter interface. #321

Closed Maikuolan closed 4 years ago

Maikuolan commented 4 years ago

When the intention exists to write numerous classes with the same or very similar methods, PHP interfaces are a useful means to ensure that accidents don't occur with method names in the future, and to ensure that such intentions are fully met insofar as such classes possessing the needed methods.

This pull request adds an adapter interface (this contributes towards the work currently being done at the dev@220 branch). This pull request also slightly cleans up some of the PHPDoc comments, and adds both parameter type hints and return types to all methods which belong to the affected classes.

codecov[bot] commented 4 years ago

Codecov Report

Merging #321 (93f0611) into dev@220 (c547cf6) will not change coverage. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             dev@220     #321   +/-   ##
==========================================
  Coverage      10.10%   10.10%           
  Complexity      1947     1947           
==========================================
  Files            114      114           
  Lines           5183     5183           
==========================================
  Hits             524      524           
  Misses          4659     4659           
Impacted Files Coverage Δ Complexity Δ
src/Archive/Adapter/Bzip.php 0.00% <0.00%> (ø) 12.00 <12.00> (ø)
src/Archive/Adapter/Gzip.php 0.00% <0.00%> (ø) 12.00 <12.00> (ø)
src/Archive/Adapter/Zip.php 0.00% <0.00%> (ø) 13.00 <13.00> (ø)
src/Archive/Archive.php 0.00% <0.00%> (ø) 7.00 <2.00> (ø)

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 c547cf6...93f0611. Read the comment docs.

peter279k commented 4 years ago
Maikuolan commented 4 years ago
  • I wonder why this PR is compared to the dev@220 branch rather than master branch.

This is intentional. This PR proposes some changes to the archive files, which currently exist in dev@220, but which don't yet exist in master (due to still being worked on at #311).

My idea behind targeting dev@220 is that, if and when this PR is merged, the commits here (#321) will appear at the end of the list of commits at the other PR (#311), but not yet at master (since the archive files are still being worked on). Then everything can appear in master later, after we're ready to merge the other PR. :-)