コード例 #1
0
 /**
  * @covers TextFile\Factory\ReaderFactory::createReader
  *
  * @expectedException \TextFile\Exception\InvalidReaderException
  */
 public function testCreateReaderInvalidReader()
 {
     $readerFactory = new ReaderFactory();
     $readerFactory->createReader(ReaderFactory::class, new SimpleWalker());
 }
コード例 #2
0
ファイル: TextFile.php プロジェクト: Babacooll/TextFile
 /**
  * @param int    $characterNumber
  * @param string $readerClass
  * @param string $walkerClass
  *
  * @return string
  * @throws InvalidReaderException
  * @throws OutOfBoundsException
  */
 public function getCharacterContent($characterNumber, $readerClass = SimpleReader::class, $walkerClass = SimpleWalker::class)
 {
     $walker = $this->walkerFactory->createWalker($walkerClass);
     return $this->readerFactory->createReader($readerClass, $walker)->getCharacterContent($this->splFileObject, $characterNumber);
 }