Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is string
is_string(mixed $value): bool
    {

        switch (
true) {



            case 
is_string($value):

                
$this->initFromString($value);

                break;
    public function isFilePath()

    {

        if (
is_string($this->data)) {

            try {

                return 
is_file($this->data);

            } catch (
\Exception $e) {
    public function isBinary()

    {

        if (
is_string($this->data)) {

            
$mime finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $this->data);

            return (
substr($mime04) != 'text' && $mime != 'application/x-empty');

        }
    public function isBase64()

    {

        if (!
is_string($this->data)) {

            return 
false;

        }
    private function decodeDataUrl($data_url)

    {

        if (!
is_string($data_url)) {

            return 
null;

        }
    protected function hasApplicableFontFile()

    {

        if (
is_string($this->file)) {

            return 
file_exists($this->file);

        }
                break;

            case 
'str':

            case 
'string':

                
$valid \is_string($value);

                
$message '%s accepts only string values as argument %d.';

                break;

            case 
'array':
        if (is_null($away)) {

            
$away = ['top''right''bottom''left'];

        } elseif (
is_string($away)) {

            
$away = [$away];

        }
        if ($this->hasApplicableFontFile()) {



            if (
$this->angle != || is_string($this->align) || is_string($this->valign)) {



                
$box $this->getBoxSize();
    private function createDriver()

    {

        if (
is_string($this->config['driver'])) {

            
$drivername ucfirst($this->config['driver']);

            
$driverclass sprintf('Intervention\\Image\\%s\\Driver'$drivername);
            $config $app['config'];




            if (
is_string($config->get('imagecache::route'))) {




                
$config->set('imagecache::templates.original'null);
        );




        if (
is_string(config('imagecache.route'))) {



            
$filename_pattern '[ \w\\.\\/\\-\\@\(\)\=]+';
        if (is_null($away)) {

            
$away = ['top''right''bottom''left'];

        } elseif (
is_string($away)) {

            
$away = [$away];

        }