Athari / YaLinqo

Yet Another LINQ to Objects for PHP [Simplified BSD]
https://athari.github.io/YaLinqo
BSD 2-Clause "Simplified" License
439 stars 39 forks source link

Remove autoload files #41

Open richwandell opened 5 years ago

richwandell commented 5 years ago

Currently I have a PHP application that I do not want to autoload Linq.php for everything, but your composer.json specifies autoload files which forced the inclusion of Linq.php for everything even when nothing is used from your library.

"autoload": {
        "psr-4": {
            "YaLinqo\\": "YaLinqo/"
        },
        "files": [
            "YaLinqo/Linq.php"
        ]
    },

I would suggest removing the files section and allow people to use the function "from" within your YaLinqo namespace.

// aliasing a function (PHP 5.6+)
use function YaLinqo\from as from;

This will also allow us to alias the from method so that we can call it something else. Maybe I want to do something like this.

// aliasing a function (PHP 5.6+)
use function YaLinqo\from as yfrom;

This could be helpful if I already have a function defined as "from".