Takes in a file, process it and output a new file with additional columns.
This commit is contained in:
Stefan Lazic
2026-07-10 15:45:02 +01:00
parent 2f387a4c1c
commit a451060c1b
876 changed files with 169373 additions and 0 deletions
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use DateTimeInterface;
use ZipStream\Exception;
/**
* This Exception gets invoked if a DOS time is overflowing
*
* @api
*/
class DosTimeOverflowException extends Exception
{
/**
* @internal
*/
public function __construct(
public readonly DateTimeInterface $dateTime
) {
parent::__construct('The date ' . $dateTime->format(DateTimeInterface::ATOM) . " can't be represented as DOS time / date.");
}
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a file wasn't found
*
* @api
*/
class FileNotFoundException extends Exception
{
/**
* @internal
*/
public function __construct(
public readonly string $path
) {
parent::__construct("The file with the path $path wasn't found.");
}
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a file isn't readable
*
* @api
*/
class FileNotReadableException extends Exception
{
/**
* @internal
*/
public function __construct(
public readonly string $path
) {
parent::__construct("The file with the path $path isn't readable.");
}
}
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a file is not as large as it was specified.
*
* @api
*/
class FileSizeIncorrectException extends Exception
{
/**
* @internal
*/
public function __construct(
public readonly int $expectedSize,
public readonly int $actualSize
) {
parent::__construct("File is {$actualSize} instead of {$expectedSize} bytes large. Adjust `exactSize` parameter.");
}
}
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a counter value exceeds storage size
*
* @api
*/
class OverflowException extends Exception
{
/**
* @internal
*/
public function __construct()
{
parent::__construct('File size exceeds limit of 32 bit integer. Please enable "zip64" option.');
}
}
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a resource like `fread` returns false
*
* @api
*/
class ResourceActionException extends Exception
{
/**
* @var ?resource
*/
public $resource;
/**
* @param resource $resource
*/
public function __construct(
public readonly string $function,
$resource = null,
) {
$this->resource = $resource;
parent::__construct('Function ' . $function . 'failed on resource.');
}
}
@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a strict simulation is executed and the file
* information can't be determined without reading the entire file.
*
* @api
*/
class SimulationFileUnknownException extends Exception
{
public function __construct()
{
parent::__construct('The details of the strict simulation file could not be determined without reading the entire file.');
}
}
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a stream can't be read.
*
* @api
*/
class StreamNotReadableException extends Exception
{
/**
* @internal
*/
public function __construct()
{
parent::__construct('The stream could not be read.');
}
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if a non seekable stream is
* provided and zero headers are disabled.
*
* @api
*/
class StreamNotSeekableException extends Exception
{
/**
* @internal
*/
public function __construct()
{
parent::__construct('enableZeroHeader must be enable to add non seekable streams');
}
}