mathiasgrimm / arraypath Goto Github PK
View Code? Open in Web Editor NEWEasy array access
License: Other
Easy array access
License: Other
should always be consistently
($array, $index, $value, $dafault)
if one argument does not exist, the order should be shifted, excluding the option that does not exist
therefore
A::get($array, 'a/b/c', 'default value');
or
A::set($array, 'a/b/c', $value);
etc...
class ArrayPath
{
public static function registerAlias($alias = 'A')
{
class_alias('MathiasGrimm\ArrayPath', $alias);
}
}
then one could just do this:
ArrayPath::registerAlias();
and then
A::get('a/b/c', $data);
A::set($value, 'a/b/c', $data);
Since you depend on \x on dev-master its impossible to install the 1.0 stable release since its dependencies are, not stable.
mathiasgrimm\arraypath
should be Mathiasgrimm\Arraypath
using StudlyCaps.
Having all of these parts would greatly increase user's faith in this library.
May i recommend looking at https://github.com/thephpleague/skeleton and following how they do these?
Should be an easy fix. You already have tests, but i also think PSR-2 would be a good fit.
Hey there,
I found that you class seems to be unmockable for PHPUnit, because all its calls are static and the state is saved staticalled, too.
I could imagine, why you would have chosen this approach, but it hinders us from mocking it away.
Do you see a way of combining a 'correct' stateful approach with your easy accessible static one? Maybe with the singleton pattern for example?
With this approach there would be almost to none changes to your existing public api, because you could hide the instanciating process in your class.
Or maybe something else, like a new major with a compatibility break?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.