Skip to content

Repository files navigation

SEworqs Phing String

A collection of Phing tasks for string casing, namespaces, path conversion, and random string generation. Useful for manipulating and transforming strings within your Phing build process.

Installation

Install via Composer:

composer require seworqs/phing-string

Usage

Import the SEworqs task library in your build.xml:

<importfile="vendor/seworqs/phing-string/resources/phing/import.xml"/>

This will register all available tasks so you can use them directly:

<camelcaseinput="convert me to camel" />
<snakecaseinput="ConvertMeToSnake" />
<namespaceinput="src/Helper/StringHelper.php" />
<pathinput="App\Helper\StringHelper" />
<randomlength="16" />

Prefer to manage task registration yourself?
You can also define tasks individually using <taskdef>. See examples/example.xml.

For more examples, see examples.xml

Features

  • Convert strings to multiple casing formats
  • Normalize namespaces from file paths
  • Generate PSR-4 style file paths from namespaces
  • Generate secure random strings
  • Easy integration via import.xml, or define tasks manually

Tasks Overview

NamespaceTask ClassPurpose
Seworqs\Phing\Task\CasingLowerCaseTaskConverts to lowercase
UpperCaseTaskConverts to uppercase
CamelCaseTaskConverts to camelCase
PascalCaseTaskConverts to PascalCase
SnakeCaseTaskConverts to snake_case
KebabCaseTaskConverts to kebab-case
ScreamingSnakeCaseTaskConverts to SCREAMING_SNAKE_CASE
ScreamingKebabCaseTaskConverts to SCREAMING-SNAKE-CASE
TitleCaseTaskConverts to Title Case
Seworqs\Phing\Task\NamespaceNamespaceTaskExtracts namespace from file path
Seworqs\Phing\Task\PathPathTaskConverts namespace to PSR-4 file path
Seworqs\Phing\Task\RandomRandomTaskGenerates a random string

License

Apache-2.0 — see LICENSE

About SEworqs

SEworqs builds clean, reusable modules for PHP and Mendix developers.

Learn more at github.com/seworqs

Badges

Latest Version
Total Downloads
License
PHP Version
Made by SEworqs

About

A collection of Phing tasks for string casing, namespaces, path conversion, and random string generation. Useful for manipulating and transforming strings within your Phing build process.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages