Skip to content

[php] Error processing of trait for php73 #1393

@Nazariy

Description

@Nazariy

Just runned in to issue while trying to inspect my code I run in to this issue:

 [ERROR] Could not process "/mnt/d/var/www/phalcon/blank/app/Controllers/BaseController/ResourceHandler.php" file by    
         "Rector\Php\Rector\FuncCall\StringifyStrNeedlesRector", due to:                                                
         "".    

The code it doesn't like:

<?php

namespace NS\Controllers\BaseController;

use Phalcon\Assets\Manager;

/**
 * Trait ResourceHandler
 * @package NS\Controllers\BaseController
 * @property Manager assets
 */
trait ResourceHandler
{
    /**
     * addResourceByType
     * @param string $path
     * @return ResourceHandler
     */
    protected function addResourceByType(string $path): self
    {
        $local = !(strpos($path, 'http') === 0);
        switch (pathinfo($path, PATHINFO_EXTENSION)) {
            case 'css':
                $this->assets->addCss($path, $local);
                break;
            case 'js':
                $this->assets->addJs($path, $local);
                break;
        }

        return $this;
    }

}

Other levels inspection seems to be OK

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions