Skip to content

Commit 14ffe03

Browse files
committed
refactor: remove unused variables
#17
1 parent 1299448 commit 14ffe03

File tree

5 files changed

+50
-50
lines changed

5 files changed

+50
-50
lines changed

src/Exception/CreateDirectoryException.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* PHP simple library for managing JSON files.
5+
/*
6+
* This file is part of https://github.com/josantonius/php-json repository.
7+
*
8+
* (c) Josantonius <hello@josantonius.dev>
79
*
8-
* @author Josantonius <hello@josantonius.dev>
9-
* @copyright 2016 (c) Josantonius
10-
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
11-
* @link https://github.com/josantonius/php-json
12-
* @since 2.0.0
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
1312
*/
13+
1414
namespace Josantonius\Json\Exception;
1515

1616
/**
1717
* You can use an exception and error handler with this library.
1818
*
19-
* @link https://github.com/josantonius/php-errorhandler
19+
* @see https://github.com/josantonius/php-error-handler
2020
*/
2121
class CreateDirectoryException extends \Exception
2222
{
23-
public function __construct(string $path, \Throwable $th = null)
23+
public function __construct(string $path)
2424
{
2525
$lastError = error_get_last()['message'] ?? '';
2626

2727
$message = "Could not create directory in '$path'.";
2828
$message .= $lastError ? " $lastError." : '';
2929

30-
parent::__construct($th ? $th->getMessage() : $message, 0, $th);
30+
parent::__construct($message);
3131
}
3232
}

src/Exception/CreateFileException.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* PHP simple library for managing JSON files.
5+
/*
6+
* This file is part of https://github.com/josantonius/php-json repository.
7+
*
8+
* (c) Josantonius <hello@josantonius.dev>
79
*
8-
* @author Josantonius <hello@josantonius.dev>
9-
* @copyright 2016 (c) Josantonius
10-
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
11-
* @link https://github.com/josantonius/php-json
12-
* @since 2.0.0
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
1312
*/
13+
1414
namespace Josantonius\Json\Exception;
1515

1616
/**
1717
* You can use an exception and error handler with this library.
1818
*
19-
* @link https://github.com/josantonius/php-errorhandler
19+
* @see https://github.com/josantonius/php-error-handler
2020
*/
2121
class CreateFileException extends \Exception
2222
{
23-
public function __construct(string $filepath, \Throwable $th = null)
23+
public function __construct(string $filepath)
2424
{
2525
$lastError = error_get_last()['message'] ?? '';
2626

2727
$message = "Could not create file '$filepath'.";
2828
$message .= $lastError ? " $lastError." : '';
2929

30-
parent::__construct($th ? $th->getMessage() : $message, 0, $th);
30+
parent::__construct($message);
3131
}
3232
}

src/Exception/GetFileException.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* PHP simple library for managing JSON files.
5+
/*
6+
* This file is part of https://github.com/josantonius/php-json repository.
7+
*
8+
* (c) Josantonius <hello@josantonius.dev>
79
*
8-
* @author Josantonius <hello@josantonius.dev>
9-
* @copyright 2016 (c) Josantonius
10-
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
11-
* @link https://github.com/josantonius/php-json
12-
* @since 2.0.0
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
1312
*/
13+
1414
namespace Josantonius\Json\Exception;
1515

1616
/**
1717
* You can use an exception and error handler with this library.
1818
*
19-
* @link https://github.com/josantonius/php-errorhandler
19+
* @see https://github.com/josantonius/php-error-handler
2020
*/
2121
class GetFileException extends \Exception
2222
{
23-
public function __construct(string $filepath, \Throwable $th = null)
23+
public function __construct(string $filepath)
2424
{
2525
$lastError = error_get_last()['message'] ?? '';
2626

2727
$message = "Error reading file: '$filepath'.";
2828
$message .= $lastError ? " $lastError." : '';
2929

30-
parent::__construct($th ? $th->getMessage() : $message, 0, $th);
30+
parent::__construct($message);
3131
}
3232
}

src/Exception/JsonErrorException.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* PHP simple library for managing JSON files.
5+
/*
6+
* This file is part of https://github.com/josantonius/php-json repository.
7+
*
8+
* (c) Josantonius <hello@josantonius.dev>
79
*
8-
* @author Josantonius <hello@josantonius.dev>
9-
* @copyright 2016 (c) Josantonius
10-
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
11-
* @link https://github.com/josantonius/php-json
12-
* @since 2.0.0
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
1312
*/
13+
1414
namespace Josantonius\Json\Exception;
1515

1616
/**
1717
* You can use an exception and error handler with this library.
1818
*
19-
* @link https://github.com/josantonius/php-errorhandler
19+
* @see https://github.com/josantonius/php-error-handler
2020
*/
2121
class JsonErrorException extends \Exception
2222
{
23-
public function __construct(\Throwable $th = null)
23+
public function __construct()
2424
{
2525
$message = 'JSON error: ' . json_last_error_msg();
2626

27-
parent::__construct($th ? $th->getMessage() : $message, 0, $th);
27+
parent::__construct($message);
2828
}
2929
}

src/Exception/UnavailableMethodException.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* PHP simple library for managing JSON files.
5+
/*
6+
* This file is part of https://github.com/josantonius/php-json repository.
7+
*
8+
* (c) Josantonius <hello@josantonius.dev>
79
*
8-
* @author Josantonius <hello@josantonius.dev>
9-
* @copyright 2016 (c) Josantonius
10-
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
11-
* @link https://github.com/josantonius/php-json
12-
* @since 2.0.0
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
1312
*/
13+
1414
namespace Josantonius\Json\Exception;
1515

1616
/**
1717
* You can use an exception and error handler with this library.
1818
*
19-
* @link https://github.com/josantonius/php-errorhandler
19+
* @see https://github.com/josantonius/php-error-handler
2020
*/
2121
class UnavailableMethodException extends \Exception
2222
{
23-
public function __construct(string $method, \Throwable $th = null)
23+
public function __construct(string $method)
2424
{
2525
$message = 'The "' . $method . '" method is not available for remote JSON files.';
2626

27-
parent::__construct($th ? $th->getMessage() : $message, 0, $th);
27+
parent::__construct($message);
2828
}
2929
}

0 commit comments

Comments
 (0)