mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-08-23 23:42:49 +02:00
php8 support
This commit is contained in:
@@ -1,30 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the nelexa/zip package.
|
||||
* (c) Ne-Lexa <https://github.com/Ne-Lexa/php-zip>
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PhpZip\Tests\Internal\CustomZip;
|
||||
|
||||
use PhpZip\IO\ZipWriter;
|
||||
use PhpZip\Model\Extra\Fields\NewUnixExtraField;
|
||||
use PhpZip\Model\Extra\Fields\NtfsExtraField;
|
||||
use PhpZip\Model\ZipContainer;
|
||||
|
||||
/**
|
||||
* Class CustomZipWriter.
|
||||
*/
|
||||
class CustomZipWriter extends ZipWriter
|
||||
{
|
||||
/**
|
||||
* ZipWriter constructor.
|
||||
*
|
||||
* @param ZipContainer $container
|
||||
*/
|
||||
public function __construct(ZipContainer $container)
|
||||
{
|
||||
// dump($container);
|
||||
parent::__construct($container);
|
||||
// dd($this->zipContainer);
|
||||
}
|
||||
|
||||
protected function beforeWrite()
|
||||
protected function beforeWrite(): void
|
||||
{
|
||||
parent::beforeWrite();
|
||||
$now = new \DateTimeImmutable();
|
||||
|
@@ -1,19 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the nelexa/zip package.
|
||||
* (c) Ne-Lexa <https://github.com/Ne-Lexa/php-zip>
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PhpZip\Tests\Internal\CustomZip;
|
||||
|
||||
use PhpZip\IO\ZipWriter;
|
||||
use PhpZip\ZipFile;
|
||||
|
||||
/**
|
||||
* Class ZipFileCustomWriter.
|
||||
*/
|
||||
class ZipFileCustomWriter extends ZipFile
|
||||
{
|
||||
/**
|
||||
* @return ZipWriter
|
||||
*/
|
||||
protected function createZipWriter()
|
||||
protected function createZipWriter(): ZipWriter
|
||||
{
|
||||
return new CustomZipWriter($this->zipContainer);
|
||||
}
|
||||
|
@@ -1,20 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the nelexa/zip package.
|
||||
* (c) Ne-Lexa <https://github.com/Ne-Lexa/php-zip>
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PhpZip\Tests\Internal\CustomZip;
|
||||
|
||||
use PhpZip\Model\Extra\Fields\NewUnixExtraField;
|
||||
use PhpZip\Model\Extra\Fields\NtfsExtraField;
|
||||
use PhpZip\ZipFile;
|
||||
|
||||
/**
|
||||
* Class ZipFileWithBeforeSave.
|
||||
*/
|
||||
class ZipFileWithBeforeSave extends ZipFile
|
||||
{
|
||||
/**
|
||||
* Event before save or output.
|
||||
*/
|
||||
protected function onBeforeSave()
|
||||
protected function onBeforeSave(): void
|
||||
{
|
||||
$now = new \DateTimeImmutable();
|
||||
$ntfsTimeExtra = NtfsExtraField::create($now, $now->modify('-1 day'), $now->modify('-10 day'));
|
||||
|
Reference in New Issue
Block a user