Download the PHP package black/address without Composer

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

Address

PHP 5.4+ library to make working with Addresses safer, easier, and fun!

SensioLabsInsight Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads

Installation

The recommended way to install Address is through Composer:

Protip: You should browse the black/address page to choose a stable version to use, avoid the @stable meta constraint.

Usage

Usage of this class is simple. A complete Postal address is based on a street (number and name), a postal code and a locality. But we also need region, post office box number and country so a complete Postal address should use all this fields.

We have 3 value objects for a complete Postal Address.

Country

A country is composed by a code and a name. This code is an ISO 3166-1 alpha-2 code and the name is in english.

Exemple

It is possible to create a Country object with two static functions.

Available functions

Exception

An Address\InvalidCountryException() will be thrown if code or name is not found in Resources\countries.php

Street

A street is composed by a number and a name.

Exemple

Available functions

PostalAddress

PostalAddress is the main Value Object. He needs all the informations but an empty string is allowed.

Available functions

Formatters

Ok now, you have a complete Postal Address but somewhere in your brain, you say:

Oh fuck, sometimes I don't have any region or post-office box and addresses are not written in France or in US with the same order and...

Don't panic, there is a formatter for that!

Three formatters are available with the same ->format() function:

Here is the mapping:

And how to use it:

License

Address is released under the MIT License. See the bundled LICENSE file for details.

Contributing

See CONTRIBUTING file.

Credits

This README is heavily inspired by Geocoder library by the great @willdurand. This guy needs your [PR][3] for the sake of the REST in PHP.

Alexandre "pocky" Balmes Flattrs if you love my work, buy me gift or hire me!


All versions of address 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 black/address contains the following files

Loading the files please wait ....