Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1.2.2 tag #40

Merged
merged 11 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 44 additions & 36 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
name: Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1, 8.0]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit
build:
runs-on: ubuntu-latest

strategy:
matrix:
php: [8.2, 8.1, 8.0]
laravel: [8]
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif
tools: composer:v2
coverage: none
ini-values: error_reporting=E_ALL

- name: Set Laravel Version
run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: composer test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ composer.lock
/.idea
.phpunit.result.cache
.php-cs-fixer.cache
.phpunit.cache
.phpactor.json
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ You can now access Madzipper with the `Madzipper` alias.
| Package | Laravel | PHP |
|:---------|:-------------------|:----------|
| **v1.3** | `9.*` | `^8.0` |
| **v1.2** | `7.* / 8.*` | `^8.0` |
| **v1.1** | `7.* / 8.*` | `>=7.3` |
| **v1.2** | `8.*` | `^8.0` |

## Simple Laravel example by using Madzipper facade

Expand Down
106 changes: 53 additions & 53 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
{
"name": "madnest/madzipper",
"description": "Wannabe successor of Chumper/Zipper package for Laravel",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Jakub Theimer",
"email": "[email protected]",
"homepage": "https://madne.st",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"ext-zip": "*",
"illuminate/support": "^8.0",
"illuminate/filesystem": "^8.0"
},
"require-dev": {
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.0",
"orchestra/testbench": "^7.0",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"Madnest\\Madzipper\\": "src/Madnest/Madzipper"
}
},
"autoload-dev": {
"psr-4": {
"Madnest\\Madzipper\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit --colors=always",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Madnest\\Madzipper\\MadzipperServiceProvider"
],
"aliases": {
"Madzipper": "Madnest\\Madzipper\\Madzipper"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
"name": "madnest/madzipper",
"description": "Wannabe successor of Chumper/Zipper package for Laravel",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Jakub Theimer",
"email": "[email protected]",
"homepage": "https://madne.st",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"ext-zip": "*",
"illuminate/support": "^8.0",
"illuminate/filesystem": "^8.0"
},
"require-dev": {
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.0",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"Madnest\\Madzipper\\": "src/Madnest/Madzipper"
}
},
"autoload-dev": {
"psr-4": {
"Madnest\\Madzipper\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit --colors=always",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Madnest\\Madzipper\\MadzipperServiceProvider"
],
"aliases": {
"Madzipper": "Madnest\\Madzipper\\Madzipper"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
14 changes: 7 additions & 7 deletions src/Madnest/Madzipper/Madzipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __destruct()
* @param RepositoryInterface|string $type The type of the archive, defaults to zip, possible are zip, phar
*
* @throws \RuntimeException
* @throws \Exception
* @throws Exception
* @throws \InvalidArgumentException
*
* @return $this Madzipper instance
Expand Down Expand Up @@ -118,7 +118,7 @@ public function make($pathToFile, $type = 'zip'): self
* Create a new zip archive or open an existing one.
*
* @param string $pathToFile
* @throws \Exception
* @throws Exception
* @return self
*/
public function zip(string $pathToFile): self
Expand All @@ -132,7 +132,7 @@ public function zip(string $pathToFile): self
* Create a new phar file or open one.
*
* @param string $pathToFile
* @throws \Exception
* @throws Exception
* @return self
*/
public function phar(string $pathToFile): self
Expand All @@ -146,7 +146,7 @@ public function phar(string $pathToFile): self
* Create a new rar file or open one.
*
* @param string $pathToFile
* @throws \Exception
* @throws Exception
* @return self
*/
public function rar(string $pathToFile): self
Expand All @@ -164,7 +164,7 @@ public function rar(string $pathToFile): self
* @param $path string The path to extract to
* @param array $files An array of files
* @param int $methodFlags The Method the files should be treated
* @throws \Exception
* @throws Exception
* @return void
*/
public function extractTo($path, array $files = [], $methodFlags = self::BLACKLIST): void
Expand Down Expand Up @@ -228,7 +228,7 @@ public function extractMatchingRegex($extractToPath, $regex)
*
* @param $filePath string The full path (including all folders) of the file in the zip
*
* @throws \Exception
* @throws Exception
*
* @return mixed returns the content or throws an exception
*/
Expand Down Expand Up @@ -518,7 +518,7 @@ private function getCurrentFolderWithTrailingSlash()
/**
* @param $pathToZip
*
* @throws \Exception
* @throws Exception
*
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Madnest/Madzipper/Repositories/ZipRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ZipRepository implements RepositoryInterface
* @param bool $create
* @param ZipArchive $archive
*
* @throws \Exception
* @throws Exception
*
* @return ZipRepository
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/MadzipperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
class MadzipperTest extends TestCase
{
/**
* @var \Madnest\Madzipper\Madzipper
* @var Madzipper
*/
public $archive;

/**
* @var \Mockery\Mock
* @var Mockery\Mock
*/
public $file;

Expand Down
2 changes: 1 addition & 1 deletion tests/Repositories/ZipRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ZipRepositoryTest extends TestCase
public $zip;

/**
* @var \Mockery\Mock
* @var Mockery\Mock
*/
public $mock;

Expand Down
Loading