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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TranscodeFilter extends php_user_filter

protected $encodingTo;

public function filter($in, $out, &$consumed, $closing)
public function filter($in, $out, &$consumed, bool $closing): int
{
while ($resource = stream_bucket_make_writeable($in)) {
if (in_array($this->encodingFrom, mb_list_encodings())) {
Expand All @@ -42,7 +42,7 @@ public function filter($in, $out, &$consumed, $closing)
return PSFS_PASS_ON;
}

public function onCreate()
public function onCreate(): bool
{
if (strpos($this->filtername, self::FILTER_NAME) !== 0) {
return false;
Expand Down Expand Up @@ -70,7 +70,7 @@ public function onCreate()
return true;
}

public function onClose()
public function onClose(): void
{
setlocale(LC_CTYPE, $this->params['locale']);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/classes/FilterScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function __construct($scopeName, $label)
* @param string $type Specifies a render mode as described above
* @param array $config A list of render mode specific config.
*/
public function displayAs($type, $config = [])
public function displayAs(string $type, $config = [])
{
$this->type = strtolower($type) ?: $this->type;
Comment thread
austinderrick marked this conversation as resolved.
$this->config = $this->evalConfig($config);
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/classes/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function options($value = null)
* @param string $type Specifies a render mode as described above
* @param array $config A list of render mode specific config.
*/
public function displayAs($type, $config = [])
public function displayAs(string $type, $config = [])
{
if (in_array($type, ['textarea', 'widget'])) {
// defaults to 'large'
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/classes/ListColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function __construct($columnName, $label)
* - number - numeric column, aligned right
* @param string $type Specifies a render mode as described above
*/
public function displayAs($type, $config)
public function displayAs(string $type, $config)
{
$this->type = strtolower($type) ?: $this->type;
$this->config = $this->evalConfig($config);
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/widgets/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public function removeScope($scopeName)
protected function makeFilterScope($name, $config)
{
$label = $config['label'] ?? null;
$scopeType = $config['type'] ?? null;
$scopeType = $config['type'] ?? 'group';
Comment thread
austinderrick marked this conversation as resolved.

$scope = new FilterScope($name, $label);
$scope->displayAs($scopeType, $config);
Expand Down
4 changes: 2 additions & 2 deletions modules/backend/widgets/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,8 @@ protected function makeFormField($name, $config = [])
* Defined field type
*/
else {
$fieldType = $config['type'] ?? null;
if (!is_string($fieldType) && $fieldType !== null) {
$fieldType = $config['type'] ?? 'text';
Comment thread
austinderrick marked this conversation as resolved.
if (!is_string($fieldType)) {
throw new ApplicationException(Lang::get(
'backend::lang.field.invalid_type',
['type' => gettype($fieldType)]
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/widgets/Lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ protected function makeListColumn($name, $config)
$config['searchable'] = false;
}

$columnType = $config['type'] ?? null;
$columnType = $config['type'] ?? 'text';
Comment thread
austinderrick marked this conversation as resolved.

$column = new ListColumn($name, $label);
$column->displayAs($columnType, $config);
Expand Down
Loading