Skip to content

string,integer,double,float gibi tip tanımlamalarını destekler

Notifications You must be signed in to change notification settings

defigam/TypeHint

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#TypeHint

Bu sınıf php de desteklenmeyen string,integer,float,double,resource tip tanımlamarını desteklenmesini sağlar.

#Kullanım

include 'src/TypeHint.php';
use Gem\Components\Security\TypeHint;
TypeHint::setErrorHandler();

####string`

function test(string $test)
{
 echo $test;
}

####integer

function test(integer $test)
{
 echo $test;
}

####float

function test(float $test)
{

echo $test;

}

####double

function test(double $test)
{

echo $test;

}

####resource

function test(resource $test){

echo $test;

}

#Dikkat

Bu şekilde tip tanımlaması yaptıktan sonra fonksiyonlarda ön tanımlı değer olarak sadece null ataması yapabilirsiniz Eğer farklı bir değer atarsanız Fatal Error hatasıyla karşılaşırız

function test(string $test = null){

echo $test;

}

About

string,integer,double,float gibi tip tanımlamalarını destekler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%