Skip to content

Commit 0a5d98c

Browse files
committed
Add invalid agument exception
Fix CS Fix typo Fix CS
1 parent 644e507 commit 0a5d98c

File tree

4 files changed

+72
-57
lines changed

4 files changed

+72
-57
lines changed

src/Alchemy/Zippy/AdapterInterface.php

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,46 @@
2121
/**
2222
* Returns the adapter name
2323
*
24-
* @return String
24+
* @return String
2525
*/
2626
public function getName();
27-
27+
2828
/**
2929
* Returns the adapter options
3030
*
31-
* @return Options
31+
* @return Options
3232
*/
3333
public function getOptions();
34-
34+
3535
/**
3636
* Sets adapter options
37-
*
38-
* @param Options $option
39-
*
40-
* @return AdapterInterface
37+
*
38+
* @param Options $option
39+
*
40+
* @return AdapterInterface
4141
*/
4242
public function setOptions(Options $option);
43-
43+
4444
/**
4545
* Opens an archive
46-
*
47-
* @param String $path The path to the archive
48-
*
49-
* @return ArchiveInterface
50-
*
51-
* @throws InvalidArgumentException in case of the provided path is not valid
52-
* @throws RuntimeException in case of failure
46+
*
47+
* @param String $path The path to the archive
48+
*
49+
* @return ArchiveInterface
50+
*
51+
* @throws InvalidArgumentException In case the provided path is not valid
52+
* @throws RuntimeException In case of failure
5353
*/
5454
public function open($path);
5555

5656
/**
5757
* Creates a new archive
58-
*
59-
* @param String $path The path to the archive
60-
*
61-
* @return ArchiveInterface
62-
*
63-
* @throws RuntimeException in case of failure
58+
*
59+
* @param String $path The path to the archive
60+
*
61+
* @return ArchiveInterface
62+
*
63+
* @throws RuntimeException In case of failure
6464
*/
6565
public function create($path);
6666

@@ -70,5 +70,4 @@ public function create($path);
7070
* @return Boolean
7171
*/
7272
public static function isSupported();
73-
7473
}

src/Alchemy/Zippy/ArchiveInterface.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ interface ArchiveInterface
1919
{
2020
/**
2121
* Adds a file into the archive
22-
*
23-
* @param String|\SplFileInfo $source The path to the file
24-
* @param String $target The archive file path, null to use the same as source
25-
*
26-
* @return ArchiveInterface
27-
*
28-
* @throws InvalidArgumentException in case of the provided source path is not valid
29-
* @throws RuntimeException in case of failure
22+
*
23+
* @param String|\SplFileInfo $source The path to the file
24+
* @param String|null $target The archive file path, null to use the same as source
25+
*
26+
* @return ArchiveInterface
27+
*
28+
* @throws InvalidArgumentException In case the provided source path is not valid
29+
* @throws RuntimeException In case of failure
3030
*/
3131
public function add($source, $target = null);
3232

3333
/**
3434
* Adds a directory into the archive
3535
36-
* @param String|\SplFileInfo $source The path to the directory
37-
* @param String $target The directory file path, null to use the same as source
38-
* @param Boolean $recursive Recurse into directories
39-
*
40-
* @return ArchiveInterface
41-
*
42-
* @throws InvalidArgumentException in case of the provided source path is not valid
43-
* @throws RuntimeException in case of failure
36+
* @param String|\SplFileInfo $source The path to the directory
37+
* @param String|null $target The directory file path, null to use the same as source
38+
* @param Boolean $recursive Recurse into directories
39+
*
40+
* @return ArchiveInterface
41+
*
42+
* @throws InvalidArgumentException In case the provided source path is not valid
43+
* @throws RuntimeException In case of failure
4444
*/
4545
public function addDirectory($source, $target = null, $recursive = true);
46-
46+
4747
/**
4848
* Removes a file from the archive
49-
*
50-
* @param FileInterface $file The file to remove
51-
*
52-
* @return ArchiveInterface
53-
*
54-
* @throws RuntimeException in case of failure
49+
*
50+
* @param FileInterface $file The file to remove
51+
*
52+
* @return ArchiveInterface
53+
*
54+
* @throws RuntimeException In case of failure
5555
*/
5656
public function remove(FileInterface $file);
5757
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Zippy.
5+
*
6+
* (c) Alchemy <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Alchemy\Zippy\Exception;
13+
14+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
15+
{
16+
}

src/Alchemy/Zippy/FileInterface.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,34 @@ class FileInterface
1717
{
1818
/**
1919
* Gets the location of a file
20-
*
20+
*
2121
* @return String
2222
*/
2323
public function getLocation();
24-
24+
2525
/**
2626
* Extracts a file from the archive to the given path
27-
*
28-
* @throws RuntimeException in case of the extraction failed
27+
*
28+
* @throws RuntimeException In case the extraction failed
2929
*/
3030
public function extract($target);
3131

3232
/**
3333
* Tells whether the current file is a directory or not
34-
*
35-
* @return Boolean
34+
*
35+
* @return Boolean
3636
*/
3737
public function isDir();
38-
38+
3939
/**
4040
* Relocates a file with the given path
41-
*
41+
*
4242
* @return FileInterface
43-
*
44-
* @throws RuntimeException in case of failure
43+
*
44+
* @throws RuntimeException In case of failure
4545
*/
4646
public function rename($location);
47-
47+
4848
/**
4949
* @inheritdoc
5050
*/

0 commit comments

Comments
 (0)