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
12 changes: 0 additions & 12 deletions docs/v3-to-v4-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ The following changes were made to the Application package between v3 and v4.

All Framework packages now require PHP 8.3 or newer.

### Access to input data

Accessing the input data in the input attribute of the application can now only be done via the `getInput()`.

```php
// Old
$app->input->getInt();

// New
$app->getInput()->getInt();
```

### Status on redirect

When calling `$app->redirect()`, you can not hand over a boolean value for the status, but always have to use an integer representing the HTTP status code.
40 changes: 40 additions & 0 deletions src/AbstractWebApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,46 @@ public function __construct(
$this->loadSystemUris();
}

/**
* Magic method to access properties of the application.
*
* @param string $name The name of the property.
*
* @return Input|null A value if the property name is valid, null otherwise.
*
* @since 2.0.0
* @deprecated 3.0 This is a B/C proxy for deprecated read accesses
*/
public function __get($name)
{
switch ($name) {
case 'input':
\trigger_deprecation(
'joomla/application',
'2.0.0',
'Accessing the input property of %s is deprecated, use the %s::getInput() method instead.',
self::class,
self::class
);

return $this->getInput();

default:
$trace = \debug_backtrace();
\trigger_error(
\sprintf(
'Undefined property via __get(): %1$s in %2$s on line %3$s',
$name,
$trace[0]['file'],
$trace[0]['line']
),
E_USER_NOTICE
);

return null;
}
}

/**
* Execute the application.
*
Expand Down