Download the PHP package joetannenbaum/mr-clean without Composer

On this page you can find all versions of the php package joetannenbaum/mr-clean. 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 mr-clean

Mr. Clean

Latest Version Build Status Coverage Status Quality Score Total Downloads

Mr. Clean is an extendible PHP cleaner that allows you to easily clean up strings, arrays, objects, and anything in between.

Table of Contents

Installation

Using composer:

Basic Usage

Fire it up like so:

Scrubbers

Scrubbers are the classes and functions that actually do the work, and you can assign as many as you want to clean your object.

Scrubbers should always be passed as an array, and will be run in the order that you specify.

Any single argument string manipulation function can be used. To reference a class, simply convert the StudlyCase to snake_case. In the example above, remove_weird_characters refers to a (fictional) class named RemoveWeirdCharacters.

Pre/Post

To save some typing, you can set scrubbers to run every time before and after each cleaning:

What Can Be Cleaned

Better question: what can't? An array of arrays, a string, an array of objects, a single object, you try it, Mr. Clean will probably be able to clean it. All of the following will work:

Cleaning Specific Keys

Sometimes you don't want to use the same scrubbers on every key in an object or associative array. No problem. Just let Mr. Clean know which ones to apply where and he'll take care of it:

You can also still specify scrubbers that should run for everything:

Available Scrubbers

Mr. Clean comes with a bevy of pre-built scrubbers you can use:

Boolean

Converts falsey text and anything considered empty to false, otherwise returns true. Falsey text includes (not case sensitive):

HTML

Strips tags not on the whitelist, removes empty content tags, and repeated opening or closing tags. The whitelist includes:

Strip CSS Attributes

Strips the style, class, and id attributes off of all HTML elements.

Nullify

If a trimmed string doesn't have any length, null it out:

Null If Repeated

If a string is just a repeated character ('1111111' or 'aaaaaaaaa') and has a length greater than two, null it out:

Strip Phone Number

Strip a phone number down to just the good bits, numbers and the letter 'x' (for extensions):

Extending

You can register custom scrubbers with Mr. Clean.

Writing a Scrubber

First, write your class. All you have to do is extend MrClean\Scrubber\BaseScrubber which adheres to MrClean\Scrubber\ScrubberInterface. There is a single property, value available to you. This is the string you will manipulate:

And that's it. Now just register your scrubber with Mr. Clean.

Registering a Scrubber

The register method will take a string indicating the full path of the class, or an array of class paths.

Now, go ahead and use it:


All versions of mr-clean with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 joetannenbaum/mr-clean contains the following files

Loading the files please wait ....