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
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
'combine_consecutive_issets' => true,
// Calling unset on multiple items should be done in one call
'combine_consecutive_unsets' => true,
// There must be no sprintf calls with only the first argument
'no_useless_sprintf' => true,
]
)
->setFinder($finder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0)
try {
$user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser();
} catch (\UnexpectedValueException $e) {
@trigger_error(\sprintf('UserFactory must be set, this will not be caught anymore in 7.0.'), E_USER_DEPRECATED);
@trigger_error('UserFactory must be set, this will not be caught anymore in 7.0.', E_USER_DEPRECATED);
$user = Factory::getUser($userId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private function checkDefaultValue($data)
try {
$rule->setDatabase($this->getDatabase());
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Indexer
public function __construct(?DatabaseInterface $db = null)
{
if ($db === null) {
@trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database will be mandatory in 5.0.', E_USER_DEPRECATED);
$db = Factory::getContainer()->get(DatabaseInterface::class);
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_finder/src/Indexer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Query
public function __construct($options, ?DatabaseInterface $db = null)
{
if ($db === null) {
@trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database will be mandatory in 5.0.', E_USER_DEPRECATED);
$db = Factory::getContainer()->get(DatabaseInterface::class);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Categories/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ protected function _load($id)
try {
$db = $this->getDatabase();
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$db = Factory::getContainer()->get(DatabaseInterface::class);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ protected function loadField($element, $group = null, $value = null)
try {
$field->setDatabase($this->getDatabase());
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$field->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Form/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ public function validate($value, $group = null, ?Registry $input = null)
try {
$rule->setDatabase($this->getDatabase());
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));
}
}
Expand All @@ -1243,7 +1243,7 @@ public function validate($value, $group = null, ?Registry $input = null)
try {
$rule->setDatabase($this->getDatabase());
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/MVC/Factory/MVCFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function createModel($name, $prefix = '', array $config = [])
try {
$model->setDatabase($this->getDatabase());
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$model->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));
}
}
Expand Down Expand Up @@ -267,7 +267,7 @@ public function createTable($name, $prefix = '', array $config = [])
try {
$db = \array_key_exists('dbo', $config) ? $config['dbo'] : $this->getDatabase();
} catch (DatabaseNotFoundException) {
@trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED);
$db = Factory::getContainer()->get(DatabaseInterface::class);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/MVC/Model/BaseDatabaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null)
$db = \array_key_exists('dbo', $config) ? $config['dbo'] : Factory::getDbo();

if ($db) {
@trigger_error(\sprintf('Database is not available in constructor in 6.0.'), E_USER_DEPRECATED);
@trigger_error('Database is not available in constructor in 6.0.', E_USER_DEPRECATED);
$this->setDatabase($db);

// Is needed, when models use the deprecated MVC DatabaseAwareTrait, as the trait is overriding the local functions
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Menu/SiteMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct($options = [])
$this->language = isset($options['language']) && $options['language'] instanceof Language ? $options['language'] : Factory::getLanguage();

if (!isset($options['db']) || !($options['db'] instanceof DatabaseDriver)) {
@trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED);
@trigger_error('Database will be mandatory in 5.0.', E_USER_DEPRECATED);
$options['db'] = Factory::getContainer()->get(DatabaseDriver::class);
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Table/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public function check()

// Check for valid name.
if (trim($this->type_title) === '') {
throw new \UnexpectedValueException(\sprintf('The title is empty'));
throw new \UnexpectedValueException('The title is empty');
}

$this->type_title = ucfirst($this->type_title);

if (empty($this->type_alias)) {
throw new \UnexpectedValueException(\sprintf('The type_alias is empty'));
throw new \UnexpectedValueException('The type_alias is empty');
}

return true;
Expand Down