2017 © Pedro Peláez
 

library lib-helper-array

image

emeraldinspirations/lib-helper-array

  • Tuesday, September 5, 2017
  • by emeraldinspirations
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Logo of the project, (*1)

lib-helper-array

A helper in emeraldinspiration's library., (*2)

The goal of this project is to hold commonly used functions that assist in manipulating base PHP datatypes., (*3)

Installing / Getting started

This project has no dependencies, so can simply be required with composer, (*4)

composer require emeraldinspirations/lib-helper-array

Features

  • mapElementFunction - Do an array_map using a function inside the array elements
  • xor - Return an array containing elements only in one of the supplied arrays

Example - mapElementFunction

<?php

use emeraldinspirations\library\helper\phpArray\PhpArray;

class DummyObject
{
    public function test(...$Append)
    {
        return $Char . implode('', $Append);
    }
    public function __construct($Char)
    {
        $this->Char = $Char;
    }
}

$Array = [
    new DummyObject('A'),
    new DummyObject('B'),
    new DummyObject('C'),
];

return PhpArray::mapElementFunction('Test', $Array, 1, 2, 3);

// Returns: ['A123', 'B123', 'C123']

Example - xor

<?php

use emeraldinspirations\library\helper\phpArray\PhpArray;

$Array1         = ['Foo', 'FooBar',        'Bar'       ];
$Array2         = [                 'foo', 'Bar', 'bar'];

return PhpArray::xor($Array1, $Array2),

// Returns:       ['Foo', 'FooBar', 'foo',        'bar'];

Contributing

I hope to expand this class to include other functions. If you'd like to contribute, please fork the repository and use a feature branch. I am new to gitHub and am eager to receive a Pull request to learn how it is done., (*5)

I am also open to feedback about how well I am being compliant with standards and "best practices." I have written software solo for years, and am trying to learn how to work better with others., (*6)

Licensing

The code in this project is licensed under MIT license., (*7)

The Versions

05/09 2017

dev-master

9999999-dev

  Sources   Download

MIT

by Matthew "Juniper" Barlett

05/09 2017

1.1.0

1.1.0.0

  Sources   Download

MIT

by Matthew "Juniper" Barlett

22/05 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

by Matthew "Juniper" Barlett

21/05 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

by Matthew "Juniper" Barlett