Download the PHP package monospice/spicy-identifier-tools without Composer

On this page you can find all versions of the php package monospice/spicy-identifier-tools. 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 spicy-identifier-tools

Spicy Identifier Tools

Build Status

An easy way to parse, convert, and format identifier names.

These tools are helpful when working with dynamic identifier names such as dynamic methods or when working between different programming languages.

Simple Example

Or just:

Installation

If you're autoloading classes (hopefully):

Basic Usage

The package comes with three tools:

Parser

Note: Although PHP doesn't support hyphens in identifier names, the hyphen methods may be useful when working between other languages that do, like HTML/CSS or Lisp (gasp!).

Formatter

Converter

At this time, the Converter class only provides a generic method:

Case Formats

The CaseFormat class contains constants that represent each case.

This package supports the following "cases" for identifiers:

Case Format Constant Name Example
Uppercase UPPERCASE ANIDENTIFIER
Lowercase LOWERCASE anidentifier
Camel Case CAMEL_CASE anIdentifier
Upper Camel Case UPPER_CAMEL_CASE or STUDLY_CAPS AnIdentifier
Camel Case with Acronyms CAMEL_CASE_WITH_ACRONYMS anIdentifierACRNM
Upper CC with Acronyms UPPER_CAMEL_CASE_WITH_ACRONYMS AnIdentifierACRNM
Underscore (snake case) UNDERSCORE or SNAKE_CASE an_identifier
Upper Underscore UPPER_UNDERSCORE An_Identifier
Capitalized Underscore CAPS_UNDERSCORE AN_IDENTIFIER
Underscore with Acronyms UNDERSCORE_WITH_ACRONYMS an_identifier_ACRNM
Upper US with Acronyms UPPER_UNDERSCORE_WITH_ACRONYMS An_Identifier_ACRNM
Hyphenated HYPHEN an-identifier
Upper Hyphenated UPPER_HYPHEN An-Identifier
Capitalized Hyphenated CAPS_HYPHEN AN-IDENTIFIER
Hyphenated Acronyms HYPHEN_WITH_ACRONYMS an-identifier-ACRNM
Upper Hy. with Acronyms UPPER_HYPHEN_WITH_ACRONYMS An-Identifier-ACRNM

Note: Because the Parser class does not perform formatting, when using the ::parse() method, one must choose a "base" case to parse from, such as CAMEL_CASE, not UPPER_CAMEL_CASE or CAMEL_CASE_WITH_ACRONYMS.

Acronyms in Identifier Names

Sometimes identifier names contain acronyms, such as JavaScript's XMLHttpRequest. The Parser class preserves these acronyms:

However, the Formatter and Converter classes will not preserve these acronyms unless one chooses an output format with acronyms:

This behavior provides flexibility when converting or normalizing identifier names.

Identifiers with Mixed Case

Although mixed case identifiers are not recommended in practice, one may use the Parser to parse identifiers that contain multiple cases:

The package does not provide support to output identifiers in a mixed format.

Extended ASCII Identifiers (Experimental)

PHP supports extended ASCII characters in identifier names. For example, the character ä in:

When parsing identifiers by underscore or hyphen, these characters have no effect. However, camel case identifiers may include words that are delimited by extended ASCII characters, such as änÏdentifierNáme.

The Spicy Identifier Tools package provides an experimental method to parse these identifiers:

The consistency of this method depends on the character encoding of the source files and the environment language and encoding settings. As a best practice, one should avoid using extended ASCII characters in identifier names.

For more information, visit the PHP Manual: http://php.net/manual/en/language.variables.basics.php

Testing

The Spicy Identifier Tools package uses PHPUnit to test input variations and PHPSpec for object behavior.

License

The MIT License (MIT). Please see the LICENSE File for more information.


All versions of spicy-identifier-tools 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 monospice/spicy-identifier-tools contains the following files

Loading the files please wait ....