Skip to content

Commit

Permalink
Added missing helper classes
Browse files Browse the repository at this point in the history
  • Loading branch information
gsirin committed Apr 7, 2024
1 parent 85b446c commit da105d1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Helper/CamelCaps.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Gsales\Helper;

class CamelCaps
{
public static function camelCaps($str)
{
$str = str_replace('_',' ', $str);
$str = ucwords($str);
$str = str_replace(' ','', $str);
return $str;
}
}
15 changes: 15 additions & 0 deletions src/Helper/DateDe2EnWithoutDateCheck.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Gsales\Helper;

class DateDe2EnWithoutDateCheck
{
public static function dateDe2EnWithoutDateCheck($string)
{
if (null == $string) return $string;
if (false != strstr($string,'-')) return $string;
//12.11.2006 -> 2006-11-12
$teile = explode('.',$string);
return $teile[2].'-'.$teile[1].'-'.$teile[0];
}
}
12 changes: 12 additions & 0 deletions src/Helper/NumberDe2En.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Gsales\Helper;

class NumberDe2En
{
public static function numberDe2En($string)
{
$string = str_replace('.','',$string);
return str_replace(',','.',$string);
}
}
12 changes: 12 additions & 0 deletions src/Helper/RemoveSpaces.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Gsales\Helper;

class RemoveSpaces
{
public static function removeSpaces($value)
{
if (null == $value) return $value;
return str_replace(' ','',$value);
}
}
16 changes: 16 additions & 0 deletions src/Helper/UppercaseAndRemoveUmlaut.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Gsales\Helper;

class UppercaseAndRemoveUmlaut
{
public static function uppercaseAndRemoveUmlaut($value)
{
if (null == $value) return $value;
$value = strtoupper($value);
$value = str_replace('&AMP;', 'U', $value);
$search = array('Ä', 'Ö', 'Ü', 'ß','ä', 'ö', 'ü', 'ß');
$replace = array('AE', 'OE', 'UE', 'SS','AE', 'OE', 'UE', 'SS');
return str_replace($search, $replace, $value);
}
}

0 comments on commit da105d1

Please sign in to comment.