for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jamosaur\HrryCi;
/**
* Class HrryCi
* @package Jamosaur\HrryCi
* @author James Wallen-Jones <[email protected]>
*/
class HrryCi
{
* @var null
public $text;
* @var array
private $vowels = ['a', 'e', 'i', 'o', 'u'];
* HrryCi constructor.
*
* @param null $text
public function __construct($text = null)
$this->text = $text;
}
* @return string
public function outpt()
return $this->hrry($this->text);
* @param $input
public function hrry($input)
$words = explode(' ', strtolower($input));
$hrry = [];
foreach ($words as $word) {
if (strlen($word) > 3) {
if (in_array($word[0], $this->vowels)) {
$word = $word[0] . str_replace($this->vowels, '', $word);
} else {
$word = str_replace($this->vowels, '', $word);
$word = str_replace(['you'], 'u', $word);
$hrry[] = $word;
return implode(' ', $hrry);