for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EFParser;
use EFParserInterface\IExcel;
/**
* Class excelParser.
* Класс содержит общие свойства и методы, которые используются в классах Sheet, Сell
*/
class Excel implements IExcel
{
* Документ
*
* @var string
public $sourceFile;
* Путь к документу
public $sourceFilePath;
* Объект ридера
public $sourceReader;
* excelParser constructor.
* @param string $file (Документ)
* @param string $path (Путь)
public function __construct($file, $path)
$this->sourceFile = $file;
$this->sourceFilePath = $path;
$this->sourceReader = $this->getReader();
$this->getReader()
object<PHPExcel_Reader_IReader>
string
$sourceReader
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* Метод возвращает ридер для документа
* @return PHPExcel_Reader_IReader (Ридер документа)
* @throws PHPExcel_Reader_Exception (Не удалось определить тип документа)
public function getReader()
$readerType = \PHPExcel_IOFactory::identify($this->sourceFilePath . $this->sourceFile);
return \PHPExcel_IOFactory::createReader($readerType);
* Метод возвращает массив с распарсенными данными, отсеивая null значения
* @param array $objPHPExcel (Масив данных полученных с помощью toArray())
* @return array
public function getData(array $objPHPExcel)
$data = array();
foreach ($objPHPExcel as $key => $item)
foreach ($item as $value)
if (!is_null($value))
$data[$key][] = $value;
return $data;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..