alphazframework / framework

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

feat: add the option to output assoc arrays fixes #261 #281

Closed ReeceM closed 4 years ago

ReeceM commented 4 years ago

This PR will add the ability to the Zest\Data\Arrays::class to output associative arrays when they are present at the end of a file.

For references and further discussion of this please look at #261 for the test data set.

The output of using this edited method is backwards compatible, it can be opted into for getting the different output.

An example: The syntax to access that would be:

$array = new Arrays;
var_export($array->dot($dataSets, true));
[
     "files.mine.type" => [
       "application/x-zip-compressed",
       "application/msword",
       "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
       "image/gif",
       "image/jpeg",
       "image/jpeg",
       "audio/mpeg",
       "video/mp4",
       "application/pdf",
       "image/png",
       "application/zip",
       "application/et-stream",
       "image/x-icon",
       "image/icon",
       "image/svg+xml",
     ],
     "files.types.image" => [
       "jpg",
       "png",
       "jpeg",
       "gif",
       "ico",
       "svg",
     ],
     "files.types.zip" => [
       "zip",
       "tar",
       "7zip",
       "rar",
     ],
     "files.types.docs" => [
       "pdf",
       "docs",
       "docx",
     ],
     "files.types.media" => [
       "mp4",
       "mp3",
       "wav",
       "3gp",
     ],
   ]
codecov[bot] commented 4 years ago

Codecov Report

Merging #281 into master will increase coverage by 0.22%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #281      +/-   ##
===========================================
+ Coverage       9.1%   9.32%   +0.22%     
- Complexity     1915    1917       +2     
===========================================
  Files           110     110              
  Lines          4835    4847      +12     
===========================================
+ Hits            440     452      +12     
  Misses         4395    4395
Impacted Files Coverage Δ Complexity Δ
src/Data/Arrays.php 91.2% <100%> (+0.51%) 102 <8> (+2) :arrow_up:

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 e75efa2...147cfce. Read the comment docs.

lablnet commented 4 years ago

@ReeceM Thanks you so much for your time to contribute

Really appreciated.