Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Latest commit

 

History

History
42 lines (36 loc) · 1.54 KB

README.md

File metadata and controls

42 lines (36 loc) · 1.54 KB

Laravel Text Spinner

build PHP Composer PHP Code Sniffer PHP Unit Tests

Packagist GitHub last commit

Install

Using composer

composer require hapheus/laravel-text-spinner

Features

Spin's a set of nested strings into plain text.

Example: "Foo{Bar|Foo}" returns "FooBar" or "FooFoo".

Usage

1. Using Class

$text = '{Ehlo|Hello|Howdy} {World|Earth|You}{!|?|.}';
$textSpinner = new HAF\TextSpinner\TextSpinner();
$spinnedText = $textSpinner->spin();

2. Using Laravel Facade

$text = '{Ehlo|Hello|Howdy} {World|Earth|You}{!|?|.}';
$spinnedText = app('text-spinner')->spin($text);
$spinnedText = App::make('text-spinner')->spin($text);
$spinnedText = TextSpinner::spin($text);

Code Quality

PHP Code Sniffer PHP Unit Tests

composer test
composer check-style