PHP Class Eduardokum\LaravelBoleto\Util

Show file Open project: eduardokum/laravel-boleto Class Usage Examples

Public Properties

Property Type Description
$bancos

Public Methods

Method Description
adiciona ( &$line, $i, $f, $value ) : array Função para add valor a linha nas posições informadas.
adiciona ( &$line, integer $i, integer $f, $value ) : array Função para add valor a linha nas posições informadas.
alphanumberOnly ( String $string ) : String Retorna somente alfanumericos
array2Controle ( array $a ) : string
controle2array ( $controle ) : null | string
convertDateToSingleYear ( $date ) Conversão para as datas no formato ddmmyyyy para ddmmyy
convertSingleStringDate ( $date ) : Carbon\Carbon Conversão da data no formato 'XXXXXX' para Carbon
criarRetornoFake ( $file, string $ocorrencia = '02' ) : string Pela remessa cria um retorno fake para testes.
dataJuliano ( $date, string $format = 'Y-m-d' ) : string
dateBrToUs ( string $date ) : string
dvSatander ( $n ) : integer
fatorVencimento ( $date, string $format = 'Y-m-d' ) : float
fatorVencimento ( Carbon\Carbon $date, string $format = 'Y-m-d' ) : integer
fatorVencimentoBack ( $factor, string $format = 'Y-m-d' ) : boolean | string
formatCnab ( $tipo, $valor, $tamanho, integer $dec, string $sFill = '' ) : string
formatCnab ( $tipo, $valor, integer $tamanho, integer $dec, string $sFill = '' ) : string
isCnab240 ( $content ) : boolean Validação para o tipo de cnab 240
isCnab400 ( $content ) : boolean Validação para o tipo de cnab 400
isHeaderRetorno ( $header ) : boolean Valida se o header é de um arquivo retorno valido, 240 ou 400 posicoes
lettersNot ( String $string ) : String Retorna somente as letras da string
lettersOnly ( String $string ) : String Retorna somente as letras da string
lower ( String $string ) : String Retorna a String em minusculo
maskString ( string $val, string $mask ) : string Função para mascarar uma string, mascara tipo ##-##-##
modulo10 ( $n ) : integer
modulo11 ( $n, integer $factor = 2, integer $base = 9, integer $rest, integer $whenTen ) : integer
modulo11Reverso ( $n, integer $earlyFactor = 2, integer $lastFactor = 9 ) : integer
nFloat ( string $number, integer $decimals = 2, boolean $showThousands = false ) : string Mostra o Valor no float Formatado
nReal ( float $number, integer $decimals = 2, boolean $symbol = true, boolean $fixed = true ) : string Mostra o Valor no real Formatado
nRealExtenso ( $value, $uppercase ) : string Mostra um numero por extenso.
normalizeChars ( string $string ) : string Função para limpar acentos de uma string
notLetters ( String $string ) : String Retorna somente as letras da string
notNumbers ( String $string ) : String Retorna somente os digitos da string
numberFormatConvenio ( $n, $loop, $insert ) : string
numberFormatConvenio ( $n, integer $loop, $insert ) : string
numberFormatGeral ( $n, $loop, $insert ) : string
numberFormatGeral ( $n, integer $loop, $insert ) : string
numberFormatValue ( $n, $loop, $insert ) : string
numberFormatValue ( string $n, integer $loop, integer $insert ) : string
numbersNot ( String $string ) : String Retorna somente os digitos da string
numbersOnly ( String $string ) : String Retorna somente os digitos da string
onlyAlphanumber ( String $string ) : String Retorna somente alfanumericos
onlyLetters ( String $string ) : String Retorna somente as letras da string
onlyNumbers ( String $string ) : String Retorna somente os digitos da string
percent ( $big, $percent ) : string Return percentage of value;
percentOf ( $big, $small, integer $defaultOnZero ) : string Return percent x of y;
remove ( $i, $f, &$array ) : string Remove trecho do array.
upFirst ( String $string ) : String Retorna a String em minusculo
upper ( String $string ) : String Retorna a String em MAIUSCULO

Method Details

adiciona() public static method

Função para add valor a linha nas posições informadas.
public static adiciona ( &$line, $i, $f, $value ) : array
$line
$i
$f
$value
return array

adiciona() public static method

Função para add valor a linha nas posições informadas.
public static adiciona ( &$line, integer $i, integer $f, $value ) : array
$line
$i integer
$f integer
$value
return array

alphanumberOnly() public static method

Retorna somente alfanumericos
public static alphanumberOnly ( String $string ) : String
$string String
return String

array2Controle() public static method

public static array2Controle ( array $a ) : string
$a array
return string

controle2array() public static method

public static controle2array ( $controle ) : null | string
$controle
return null | string

convertDateToSingleYear() public static method

Conversão para as datas no formato ddmmyyyy para ddmmyy
public static convertDateToSingleYear ( $date )

convertSingleStringDate() public static method

Conversão da data no formato 'XXXXXX' para Carbon
public static convertSingleStringDate ( $date ) : Carbon\Carbon
$date
return Carbon\Carbon

criarRetornoFake() public static method

Pela remessa cria um retorno fake para testes.
public static criarRetornoFake ( $file, string $ocorrencia = '02' ) : string
$file Remessa
$ocorrencia string
return string

dataJuliano() public static method

public static dataJuliano ( $date, string $format = 'Y-m-d' ) : string
$date
$format string
return string

dateBrToUs() public static method

public static dateBrToUs ( string $date ) : string
$date string
return string

dvSatander() public static method

public static dvSatander ( $n ) : integer
$n
return integer

fatorVencimento() public static method

public static fatorVencimento ( $date, string $format = 'Y-m-d' ) : float
$date
$format string
return float

fatorVencimento() public static method

public static fatorVencimento ( Carbon\Carbon $date, string $format = 'Y-m-d' ) : integer
$date Carbon\Carbon
$format string
return integer

fatorVencimentoBack() public static method

public static fatorVencimentoBack ( $factor, string $format = 'Y-m-d' ) : boolean | string
$factor
$format string
return boolean | string

formatCnab() public static method

public static formatCnab ( $tipo, $valor, $tamanho, integer $dec, string $sFill = '' ) : string
$tipo
$valor
$tamanho
$dec integer
$sFill string
return string

formatCnab() public static method

public static formatCnab ( $tipo, $valor, integer $tamanho, integer $dec, string $sFill = '' ) : string
$tipo
$valor
$tamanho integer
$dec integer
$sFill string
return string

isCnab240() public static method

Validação para o tipo de cnab 240
public static isCnab240 ( $content ) : boolean
$content
return boolean

isCnab400() public static method

Validação para o tipo de cnab 400
public static isCnab400 ( $content ) : boolean
$content
return boolean

isHeaderRetorno() public static method

Valida se o header é de um arquivo retorno valido, 240 ou 400 posicoes
public static isHeaderRetorno ( $header ) : boolean
$header
return boolean

lettersNot() public static method

Retorna somente as letras da string
public static lettersNot ( String $string ) : String
$string String
return String

lettersOnly() public static method

Retorna somente as letras da string
public static lettersOnly ( String $string ) : String
$string String
return String

lower() public static method

Retorna a String em minusculo
public static lower ( String $string ) : String
$string String
return String

maskString() public static method

Função para mascarar uma string, mascara tipo ##-##-##
public static maskString ( string $val, string $mask ) : string
$val string
$mask string
return string

modulo10() public static method

public static modulo10 ( $n ) : integer
$n
return integer

modulo11() public static method

public static modulo11 ( $n, integer $factor = 2, integer $base = 9, integer $rest, integer $whenTen ) : integer
$n
$factor integer
$base integer
$rest integer
$whenTen integer
return integer

modulo11Reverso() public static method

public static modulo11Reverso ( $n, integer $earlyFactor = 2, integer $lastFactor = 9 ) : integer
$n
$earlyFactor integer
$lastFactor integer
return integer

nFloat() public static method

Mostra o Valor no float Formatado
public static nFloat ( string $number, integer $decimals = 2, boolean $showThousands = false ) : string
$number string
$decimals integer
$showThousands boolean
return string

nReal() public static method

Mostra o Valor no real Formatado
public static nReal ( float $number, integer $decimals = 2, boolean $symbol = true, boolean $fixed = true ) : string
$number float
$decimals integer
$symbol boolean
$fixed boolean
return string

nRealExtenso() public static method

Mostra um numero por extenso.
public static nRealExtenso ( $value, $uppercase ) : string
$value
$uppercase 1 - UPPER; 2 - Upper; false - tudo minusculo;
return string

normalizeChars() public static method

Função para limpar acentos de uma string
public static normalizeChars ( string $string ) : string
$string string
return string

notLetters() public static method

Retorna somente as letras da string
public static notLetters ( String $string ) : String
$string String
return String

notNumbers() public static method

Retorna somente os digitos da string
public static notNumbers ( String $string ) : String
$string String
return String

numberFormatConvenio() public static method

public static numberFormatConvenio ( $n, $loop, $insert ) : string
$n
$loop
$insert
return string

numberFormatConvenio() public static method

public static numberFormatConvenio ( $n, integer $loop, $insert ) : string
$n
$loop integer
$insert
return string

numberFormatGeral() public static method

public static numberFormatGeral ( $n, $loop, $insert ) : string
$n
$loop
$insert
return string

numberFormatGeral() public static method

public static numberFormatGeral ( $n, integer $loop, $insert ) : string
$n
$loop integer
$insert
return string

numberFormatValue() public static method

public static numberFormatValue ( $n, $loop, $insert ) : string
$n
$loop
$insert
return string

numberFormatValue() public static method

public static numberFormatValue ( string $n, integer $loop, integer $insert ) : string
$n string
$loop integer
$insert integer
return string

numbersNot() public static method

Retorna somente os digitos da string
public static numbersNot ( String $string ) : String
$string String
return String

numbersOnly() public static method

Retorna somente os digitos da string
public static numbersOnly ( String $string ) : String
$string String
return String

onlyAlphanumber() public static method

Retorna somente alfanumericos
public static onlyAlphanumber ( String $string ) : String
$string String
return String

onlyLetters() public static method

Retorna somente as letras da string
public static onlyLetters ( String $string ) : String
$string String
return String

onlyNumbers() public static method

Retorna somente os digitos da string
public static onlyNumbers ( String $string ) : String
$string String
return String

percent() public static method

Return percentage of value;
public static percent ( $big, $percent ) : string
$big
$percent
return string

percentOf() public static method

Return percent x of y;
public static percentOf ( $big, $small, integer $defaultOnZero ) : string
$big
$small
$defaultOnZero integer
return string

remove() public static method

Remove trecho do array.
public static remove ( $i, $f, &$array ) : string
$i
$f
$array
return string

upFirst() public static method

Retorna a String em minusculo
public static upFirst ( String $string ) : String
$string String
return String

upper() public static method

Retorna a String em MAIUSCULO
public static upper ( String $string ) : String
$string String
return String

Property Details

$bancos public static property

public static $bancos