Download the PHP package sebastiaanluca/php-helpers without Composer

On this page you can find all versions of the php package sebastiaanluca/php-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-helpers

An extensive set of PHP helper functions and classes

Latest stable release Build status Total downloads Total stars

Read my blog View my other packages and projects Follow @sebastiaanluca on Twitter Share this package on Twitter

Table of contents

Requirements

How to install

Via Composer:

All function helpers will be enabled by default (if those functions haven't already been defined). Class helpers are enabled per-case when used.

You can find more info on how to use a helper and what there requirements are in their respective section (see the table of contents above for an overview).

Global helper functions

rand_bool

Randomly return true or false.

str_wrap

Wrap a string with another string.

is_assoc_array

Check if an array is associative.

Performs a simple check to determine if the given array's keys are numeric, start at 0, and count up to the amount of values it has.

array_expand

Expand a flat dotted array into a multi-dimensional associative array.

If a key is encountered that is already present and the existing value is an array, each new value will be added to that array. If it's not an array, each new value will override the existing one.

array_without

Get the array without the given values.

Accepts either an array or a value as parameter to remove.

array_pull_value

Pull a single value from a given array.

Returns the given value if it was successfully removed from the source array or null if it was not found.

array_pull_values

Pull an array of values from a given array.

Returns the values that were successfully removed from the source array or an empty array if none were found.

array_hash

Create a unique string identifier for an array.

The identifier will be entirely unique for each combination of keys and values.

object_hash

Create a unique string identifier for an object.

Similar to array_hash, this uses serialize to stringify all public properties first. The identifier will be entirely unique based on the object class, properties, and its values.

has_public_method

Check if a class has a certain public method.

carbon

Create a Carbon datetime object from a string or return a new object referencing the current date and time.

Requires the nesbot/carbon package.

temporary_file

Create a temporary file.

Returns an array with the file handle (resource) and the full path as string.

The temporary file is readable and writeable by default. The file is automatically removed when closed (for example, by calling fclose() on the handle, or when there are no remaining references to the file handle), or when the script ends.

See for more information.

Class helpers

Enum trait

The primary use of the Enum trait is to enable you to store all cases of a specific type in a single class or value object and have it return those with a single call.

This can be useful for instance when your database uses integers to store states, but you want to use descriptive strings throughout your code (i.e. enums). It also allows you to refactor these elements at any time without having to waste time searching your code for any raw values (and probably miss a few, introducing new bugs along the way).

Retrieving elements

Returns an array of element keys and their values.

Retrieving element keys

Returns all the keys of the elements in an enum.

Retrieving constant values

Returns all the values of the elements in an enum.

ProvidesClassInfo trait

The ProvidesClassInfo trait provides an easy-to-use getClassDirectory() helper method that returns the directory of the current class.

MethodHelper

A static class helper to help you figure out the visibility/accessibility of an object's methods.

License

This package operates under the MIT License (MIT). Please see LICENSE for more information.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CODE OF CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

About

My name is Sebastiaan and I'm a freelance back-end developer specializing in building custom Laravel applications. Check out my portfolio for more information, my blog for the latest tips and tricks, and my other packages to kick-start your next project.

Have a project that could use some guidance? Send me an e-mail at [email protected]!


All versions of php-helpers with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sebastiaanluca/php-helpers contains the following files

Loading the files please wait ....