namespace Org\Mxchange\CoreFramework\Filesystem\Pointer\Text;
// Import framework stuff
-use Org\Mxchange\CoreFramework\FileSystem\BaseFileIo;
+use Org\Mxchange\CoreFramework\Filesystem\BaseFileIo;
use Org\Mxchange\CoreFramework\Filesystem\Pointer\OutputPointer;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*
* @return void
*/
- protected function __construct () {
+ private function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
if (empty($mode)) {
// No filename given
throw new InvalidArgumentException('Parameter "mode" is empty');
- } // END - if
+ }
// Try to open a handler
$fileObject = $fileInstance->openFile($mode);
if ((is_null($fileObject)) || ($fileObject === false)) {
// Something bad happend
throw new FileIoException($fileInstance, self::EXCEPTION_FILE_POINTER_INVALID);
- } // END - if
+ }
// Create new instance
$pointerInstance = new FrameworkTextFileOutputPointer();
* @throws NullPointerException If the file pointer instance is not set by setFileObject()
* @throws LogicException If there is no object being set
*/
- public function writeToFile ($dataStream) {
+ public function writeToFile (string $dataStream) {
if (is_null($this->getFileObject())) {
// Pointer not initialized
throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
* @return void
* @throws UnsupportedOperationException If this method is called
*/
- public function analyzeFile () {
+ public function analyzeFileStructure () {
throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}
* @return mixed Number of writes bytes or false on error
* @throws UnsupportedOperationException If this method is called
*/
- public function writeAtPosition ($seedPosition, $data) {
+ public function writeAtPosition (int $seedPosition, string $data) {
throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}