Skip to content
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
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CHANGELOG

## v2.0.5 (unreleased)
## v2.0.5 (Current) (Stable)

**Installation:**
```bash
composer require dconco/phpspa:v2.0.5.x-dev
composer require dconco/phpspa:v2.0.5
```

### What's Added
Expand Down Expand Up @@ -54,7 +54,7 @@ new Component(...)
->meta(property: 'og:title', content: 'PhpSPA Design System');
```

**Documentation:** [references/component-meta](https://phpspa.readthedocs.io/en/latest/references/component-meta)
**Documentation:** [references/component-meta](https://phpspa.tech/references/component-meta)


#### **`useCallback()`**
Expand Down Expand Up @@ -102,11 +102,16 @@ $app



## v2.0.4 (Current) (Stable)
## v2.0.4

> [!IMPORTANT]
> This version requires **PHP 8.4 or higher**

**Installation:**
```bash
composer require dconco/phpspa:v2.0.4
```

### **Client-Side Hooks** ⚛️

- **`useEffect()`** - Manage side effects and cleanups in your component scripts with dependency tracking
Expand Down Expand Up @@ -259,6 +264,11 @@ $app->prefix('/api', function (Router $router) {

## v2.0.3

**Installation:**
```bash
composer require dconco/phpspa:v2.0.3
```

### ✨ New Features

#### **Native C++ Compression Engine** ⚡
Expand Down
12 changes: 6 additions & 6 deletions app/core/Client/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ public function prepareAsync(string $url, string $method, array $headers, ?strin
curl_setopt($ch, CURLOPT_TIMEOUT_MS, (int)($timeout * 1000));
} else {
// Use seconds for timeouts >= 1
curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, (int) $timeout);
}

$connectTimeout = $options['connect_timeout'] ?? 10;
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (int) $connectTimeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl'] ?? false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? false) ? 2 : 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl'] ?? true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? true) ? 2 : 0);
Comment on lines +199 to +200
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default SSL verification from false to true is a breaking change for existing code that relies on the current default behavior. This could cause existing HTTP requests to fail if they were connecting to endpoints with self-signed certificates or other SSL issues. While enabling SSL verification by default is a security best practice, this change should be clearly documented as a breaking change in the changelog and potentially versioned as a major release (v3.0.0) rather than a patch release (v2.0.5).

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback


// --- Handle Unix Socket ---
if (isset($options['unix_socket_path'])) {
Expand All @@ -207,11 +207,11 @@ public function prepareAsync(string $url, string $method, array $headers, ?strin
if (isset($options['cert_path'])) {
curl_setopt($ch, CURLOPT_CAINFO, $options['cert_path']);
}

if (isset($options['user_agent'])) {
curl_setopt($ch, CURLOPT_USERAGENT, $options['user_agent']);
}

// Build headers array for cURL
$curlHeaders = [];
foreach ($headers as $key => $value) {
Expand Down
6 changes: 6 additions & 0 deletions app/core/Client/PendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public function connectTimeout(int $seconds): PendingRequest
return $this;
}

public function unixSocketPath(string $path): PendingRequest
{
$this->options['unix_socket_path'] = $path;
return $this;
Comment on lines +124 to +127
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method duplicates the functionality of the unixSocket() method at lines 140-144. Both methods set the same option unix_socket_path and have identical behavior. The unixSocket() method has comprehensive documentation while this method has none. Consider removing this duplicate method to avoid confusion and maintain a single, well-documented API.

Suggested change
public function unixSocketPath(string $path): PendingRequest
{
$this->options['unix_socket_path'] = $path;
return $this;
/**
* Alias for {@see PendingRequest::unixSocket()}.
*
* @deprecated Use {@see PendingRequest::unixSocket()} instead.
*
* @param string $path Absolute or relative filesystem path to the Unix socket file.
* @return PendingRequest Returns the current instance for fluent chaining.
*/
public function unixSocketPath(string $path): PendingRequest
{
return $this->unixSocket($path);

Copilot uses AI. Check for mistakes.
}

/**
* Set the Unix domain socket path to be used for this pending request.
*
Expand Down
7 changes: 5 additions & 2 deletions app/core/Helper/StateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ public function __construct(string $stateKey, $default)
* @param mixed $value Optional value to be processed when the object is invoked.
* @return mixed The result of the invocation, depending on the implementation.
*/
Comment on lines 68 to 70
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docblock is now outdated. It mentions an optional $value parameter that no longer exists in the method signature. The docblock should be updated to reflect that the method now uses variadic argument checking with func_num_args() and func_get_arg() instead of a named parameter with a default value.

Copilot uses AI. Check for mistakes.
public function __invoke($value = UNDEFINED_STATE_VARIABLE)
public function __invoke()
{
$sessionData = SessionHandler::get(STATE_HANDLE);

if ($value === UNDEFINED_STATE_VARIABLE) {
// If no argument was passed, return the current state value.
if (\func_num_args() === 0) {
return $sessionData[$this->stateKey] ?? $this->value;
}
// An argument was explicitly provided (even if it is falsy); treat it as the new state value.
$value = func_get_arg(0);

$this->lastState = $this->value ?? Validate::validate($value);
$this->value = $value;
Expand Down
4 changes: 2 additions & 2 deletions badge/loc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/references/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

Learn how the `@dconco/phpspa` package bootstraps navigation, state sync, and client helpers.

[:octicons-arrow-right-24: Open guide](https://phpspa-client.vercel.app)
[:octicons-arrow-right-24: Open guide](https://phpspa-client.up.railway.app)

</div>

Expand Down