Giter Club home page Giter Club logo

ardent's People

Contributors

asm89 avatar c9s avatar igorw avatar ircmaxell avatar jeroendedauw avatar jmikola avatar joshdifabio avatar mcordingley avatar morrisonlevi avatar nikic avatar ocramius avatar rdlowrey avatar serafimarts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ardent's Issues

Filter and Sort arbitrary Collections

Is it possible to apply multiple filters on arbitrary Collections of this package? I just found a solution to apply a single filter (should be possible by using CallbackFilterIterator).

And is there a preferred or standardised way to sort a collection of objects by a specific attribute?

Rename methods in Collections API.

Using the name contains as a method that take a function is really not very nice from an API perspective. Many collections have specialized ways of finding things that is separate from the normal Collections API. For now, those have been named containsItem or something similar. I'd like to rename containsItem to contains, so I need a new name for the current contains. Looking at the current Collection API, we have names like every and none, so how about one?

And how about renaming every to all?

Excessive star accrual

๐Ÿ‘ Congratulations on 50 repo-stars. It's not really an issue, but I wanted to break in the issue tracker

Should Ardent have a TypeException?

I would throw an EngineException (PHP7) for consistency with PHP's own type hinting.
Or, better, I'd use trigger_error() for PHP5 compatibility (which would presumably result in a EngineException in PHP7)

No last/first methods on sets

There is no last or first method (to retrieve the first or last item, of course) on the set classes. This seems like it'd be something useful to have (and is present in other implementations of sets).

Binding to specific class (aka type template)

Hi, this is a feature request / question rather than a bug. Straight to the point:

Does the current implementation allow for an equivalent of Vector<Student>, which would only allow insertion of Student instances (or descendants)?

While it would be a nice and useful feature, I can see how it would complicate both the nomenclature and api if there were implemented as Vector and TypedVector or whatever (and analogies for other templates). Another way would be somewhat like setType() on the current classes, but that feels like it wouldn't properly communicate it's implications once used in code.

I suppose I can always extend the current implementation and override the insert (or equivalent) method with type checking, but it would basically create a class that would have to be copied project to project every time.

Any thoughts on this?

PS: It would be so great for this collection if php actually supported type templates.

how to use and test?

Hello ! How to use this library ? And how to use PHPUnit to test code ? Have anyone will tell me ?
Thank you.

SlicingIterator preserves keys: should it?

My expectation on a slice is that the keys would be renumbered, since slicing something that doesn't really have an order is sort-of undefined. There needs to be some expectations clearly outlined on this somewhere, and I'm not sure what they should be.

HashMap toArray() does not use $preserveKeys by default

While $preserveKeys = FALSE is default everywhere, wouldn't it be better to break the consistency for Maps? Or better yet, preserve keys by default? It feels like it should be more general use case.

From the user standpoint, I would rather use self describing $map->toArray(). The additional boolean argument is not self explanatory (on first sight, without checking the function declaration). And while $map->toArray($withKeys = TRUE); is readable, it does not really cut the mustard as it's waaaay too long.

Let Composer Handle Autoloading

I see that the library currently implements its own autoload function. Why not just use PSR-4 autoloading and let Composer handle this? It'll make it easier to alter this library while it is on its way to 1.0 and will make it simpler for others to contribute.

If your concern is about performance, your current implementation is a class map. Running composer with the -o flag will generate a class map, instead of attempting to map namespaces to file system locations. Performance should be the same at that point and you'll have DRYer code, as you won't be repeating logic found elsewhere.

Define Hashable Interface

For map implementation, expecially HashMap it advantage for us to define Hashable interface, this interface only require 2 method: hashCode and isEquals modeled after Java. The advantage having this interface are the HashMap no longer take hashfunction argument and move the responsibily of compare two key is equal to the interface. It maybe overkill what do you think?

Method visibility

I've been looking though this library a bit and started wondering why most methods do not have an explicit visibility declared. Is there a reason for using function foo rather than public function foo?

There are places where I am wondering if things are intentionally public or are just missing either private or protected. For instance HashMap::areEqual. This method does not make sense as part of this the public interface of this class. An anonymous function could be used in contains. Though perhaps it is done like this to allow overriding in derivatives of HashMap?

Define some basic naming conventions.

Currently we have names like first and last but also have names like getLeft and getHeight. I'm not sure which convention I'd like to use just yet, but having both rubs me the wrong way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.