N98\Magento\Command\Developer\Ide\PhpStorm\MetaCommand::isClassDefinedInFile PHP Метод

isClassDefinedInFile() защищенный Метод

Verify whether given class is defined in given file because there is no sense in adding class with incorrect file or path. Examples: app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php -> Mage_Core_Model_Mysql4_Design_Theme app/code/core/Mage/Payment/Model/Paygate/Request.php -> Mage_Paygate_Model_Authorizenet_Request app/code/core/Mage/Dataflow/Model/Convert/Iterator.php -> Mage_Dataflow_Model_Session_Adapter_Iterator
protected isClassDefinedInFile ( Symfony\Component\Finder\SplFileInfo $file, string $className, Symfony\Component\Console\Output\OutputInterface $output ) : boolean
$file Symfony\Component\Finder\SplFileInfo
$className string
$output Symfony\Component\Console\Output\OutputInterface
Результат boolean
    protected function isClassDefinedInFile(SplFileInfo $file, $className, OutputInterface $output)
    {
        try {
            return preg_match("/class\\s+{$className}/m", $file->getContents());
        } catch (Exception $e) {
            $output->writeln('<error>File: ' . $file->__toString() . ' | ' . $e->getMessage() . '</error>');
            return false;
        }
    }