Skip to content
Open
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 2.0.0

#### Changes

* Requires PHP >= 7.2
* Static signature typing to the level of PHP 7.2
* Nothing else changed

#### New features/improvements

* Works with `symfony/event-dispatcher` `^5.0`, `^6.0`
* Improved static typing and phpdoc annotations

#### Dev

* Upgraded `phpunit/phpunit`
39 changes: 21 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
"name": "stil/curl-easy",
"description": "cURL wrapper for PHP. Supports parallel and non-blocking requests. For high speed crawling, see stil/curl-robot.",
"license": "MIT",
"require": {
"symfony/event-dispatcher": "^3.2"
},
"require-dev": {
"phpunit/phpunit": "^6.1"
},
"autoload": {
"psr-4": {
"cURL\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"cURL\\Tests\\": "tests/"
}
"name": "stil/curl-easy",
"version": "2.0.0",
"description": "cURL wrapper for PHP. Supports parallel and non-blocking requests. For high speed crawling, see stil/curl-robot.",
"license": "MIT",
"require": {
"symfony/event-dispatcher": "^5.0 || ^6.0",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"ext-json": "*"
},
"autoload": {
"psr-4": {
"cURL\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"cURL\\Tests\\": "tests/"
}
}
}
8 changes: 4 additions & 4 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Collection
*
* @return array
*/
public function toArray()
public function toArray(): array
{
return $this->data;
}
Expand All @@ -26,7 +26,7 @@ public function toArray()
* @param mixed $value Value
* @return self
*/
public function set($key, $value = null)
public function set($key, $value = null): self
{
if (is_array($key)) {
foreach ($key as $k => $v) {
Expand All @@ -44,7 +44,7 @@ public function set($key, $value = null)
* @param mixed $key Key
* @return bool TRUE if exists, FALSE otherwise
*/
public function has($key)
public function has($key): bool
{
return isset($this->data[$key]);
}
Expand All @@ -71,7 +71,7 @@ public function get($key)
* @param mixed $key Key to remove
* @return self
*/
public function remove($key)
public function remove($key): self
{
unset($this->data[$key]);
return $this;
Expand Down
6 changes: 3 additions & 3 deletions src/ConstantsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
class ConstantsTable
{
/**
* @var int[] Array of cURL constants required for intelligent setters
* @var array<string,int> Array of cURL constants required for intelligent setters
*/
protected static $curlConstantsTable = array();

/**
* @return array
*/
public static function loadCurlConstantsTable()
public static function loadCurlConstantsTable(): array
{
if (empty(self::$curlConstantsTable)) {
$constants = get_defined_constants(true);
Expand All @@ -32,7 +32,7 @@ public static function loadCurlConstantsTable()
* @return int
* @throws Exception
*/
public static function findNumericValue($const)
public static function findNumericValue(string $const): int
{
$table = self::loadCurlConstantsTable();

Expand Down
2 changes: 1 addition & 1 deletion src/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace cURL;

use Symfony\Component\EventDispatcher\Event as SymfonyEvent;
use Symfony\Contracts\EventDispatcher\Event as SymfonyEvent;

class Event extends SymfonyEvent
{
Expand Down
Loading