Skip to content

Commit ccbef01

Browse files
committed
Update: Update php-cs-fixer to v3.51
Apply rule fixes
1 parent 30a2fc5 commit ccbef01

34 files changed

+42
-42
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: shivammathur/setup-php@v2
1717
with:
1818
php-version: 8.2
19-
tools: php-cs-fixer:3.45, cs2pr
19+
tools: php-cs-fixer:3.51, cs2pr
2020

2121
- uses: actions/cache@v4
2222
with:

lib/cache/sfFileCache.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ protected function write($path, $data, $timeout)
262262

263263
$cacheDir = dirname($path);
264264
if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
265-
throw new \sfCacheException(sprintf('Cache was not able to create a directory "%s".', $cacheDir));
265+
throw new sfCacheException(sprintf('Cache was not able to create a directory "%s".', $cacheDir));
266266
}
267267

268268
$tmpFile = tempnam($cacheDir, basename($path));

lib/command/sfCommandApplication.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract class sfCommandApplication
6060
* @param sfFormatter $formatter A sfFormatter instance
6161
* @param array $options An array of options
6262
*/
63-
public function __construct(sfEventDispatcher $dispatcher, sfFormatter $formatter = null, $options = array())
63+
public function __construct(sfEventDispatcher $dispatcher, ?sfFormatter $formatter = null, $options = array())
6464
{
6565
$this->dispatcher = $dispatcher;
6666
$this->formatter = null === $formatter ? $this->guessBestFormatter(STDOUT) : $formatter;

lib/command/sfCommandManager.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class sfCommandManager
4242
* @param sfCommandArgumentSet $argumentSet A sfCommandArgumentSet object
4343
* @param sfCommandOptionSet $optionSet A setOptionSet object
4444
*/
45-
public function __construct(sfCommandArgumentSet $argumentSet = null, sfCommandOptionSet $optionSet = null)
45+
public function __construct(?sfCommandArgumentSet $argumentSet = null, ?sfCommandOptionSet $optionSet = null)
4646
{
4747
if (null === $argumentSet) {
4848
$argumentSet = new sfCommandArgumentSet();

lib/config/sfApplicationConfiguration.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ abstract class sfApplicationConfiguration extends ProjectConfiguration
3333
* @param string $rootDir The project root directory
3434
* @param sfEventDispatcher $dispatcher An event dispatcher
3535
*/
36-
public function __construct($environment, $debug, $rootDir = null, sfEventDispatcher $dispatcher = null)
36+
public function __construct($environment, $debug, $rootDir = null, ?sfEventDispatcher $dispatcher = null)
3737
{
3838
$this->environment = $environment;
3939
$this->debug = (bool) $debug;

lib/config/sfConfigCache.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ protected function writeCacheFile($config, $cache, $data)
313313
$current_umask = umask(0000);
314314
$cacheDir = dirname($cache);
315315
if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
316-
throw new \sfCacheException(sprintf('Failed to make cache directory "%s" while generating cache for configuration file "%s".', $cacheDir, $config));
316+
throw new sfCacheException(sprintf('Failed to make cache directory "%s" while generating cache for configuration file "%s".', $cacheDir, $config));
317317
}
318318

319319
$tmpFile = tempnam($cacheDir, basename($cache));

lib/config/sfProjectConfiguration.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class sfProjectConfiguration
4848
* @param string $rootDir The project root directory
4949
* @param sfEventDispatcher $dispatcher The event dispatcher
5050
*/
51-
public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null)
51+
public function __construct($rootDir = null, ?sfEventDispatcher $dispatcher = null)
5252
{
5353
if (null === self::$active || $this instanceof sfApplicationConfiguration) {
5454
self::$active = $this;
@@ -589,7 +589,7 @@ public static function guessRootDir()
589589
*
590590
* @return sfApplicationConfiguration A sfApplicationConfiguration instance
591591
*/
592-
public static function getApplicationConfiguration($application, $environment, $debug, $rootDir = null, sfEventDispatcher $dispatcher = null)
592+
public static function getApplicationConfiguration($application, $environment, $debug, $rootDir = null, ?sfEventDispatcher $dispatcher = null)
593593
{
594594
$class = $application.'Configuration';
595595

lib/debug/sfDebug.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function settingsAsArray()
9999
*
100100
* @return array The request parameter holders
101101
*/
102-
public static function requestAsArray(sfRequest $request = null)
102+
public static function requestAsArray(?sfRequest $request = null)
103103
{
104104
if (!$request) {
105105
return array();
@@ -119,7 +119,7 @@ public static function requestAsArray(sfRequest $request = null)
119119
*
120120
* @return array The response parameters
121121
*/
122-
public static function responseAsArray(sfResponse $response = null)
122+
public static function responseAsArray(?sfResponse $response = null)
123123
{
124124
if (!$response) {
125125
return array();
@@ -144,7 +144,7 @@ public static function responseAsArray(sfResponse $response = null)
144144
*
145145
* @return array The user parameters
146146
*/
147-
public static function userAsArray(sfUser $user = null)
147+
public static function userAsArray(?sfUser $user = null)
148148
{
149149
if (!$user) {
150150
return array();

lib/form/addon/sfFormSymfony.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __call($method, $arguments)
6161
/**
6262
* Sets the event dispatcher to be used by all forms.
6363
*/
64-
public static function setEventDispatcher(sfEventDispatcher $dispatcher = null)
64+
public static function setEventDispatcher(?sfEventDispatcher $dispatcher = null)
6565
{
6666
self::$dispatcher = $dispatcher;
6767
}

lib/form/sfForm.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function getGlobalErrors()
214214
* @param array $taintedValues An array of input values
215215
* @param array $taintedFiles An array of uploaded files (in the $_FILES or $_GET format)
216216
*/
217-
public function bind(array $taintedValues = null, array $taintedFiles = null)
217+
public function bind(?array $taintedValues = null, ?array $taintedFiles = null)
218218
{
219219
$this->taintedValues = $taintedValues;
220220
$this->taintedFiles = $taintedFiles;
@@ -254,7 +254,7 @@ public function bind(array $taintedValues = null, array $taintedFiles = null)
254254
/**
255255
* Bind embedded forms (recursivly).
256256
*/
257-
public function bindEmbeddedForms(array $taintedValues = null, array $taintedFiles = null)
257+
public function bindEmbeddedForms(?array $taintedValues = null, ?array $taintedFiles = null)
258258
{
259259
foreach ($this->embeddedForms as $name => $form) {
260260
// remove CSRF token
@@ -519,7 +519,7 @@ public function mergeForm(sfForm $form)
519519
*
520520
* @param sfValidatorBase $validator A validator to be merged
521521
*/
522-
public function mergePreValidator(sfValidatorBase $validator = null)
522+
public function mergePreValidator(?sfValidatorBase $validator = null)
523523
{
524524
if (null === $validator) {
525525
return;
@@ -540,7 +540,7 @@ public function mergePreValidator(sfValidatorBase $validator = null)
540540
*
541541
* @param sfValidatorBase $validator A validator to be merged
542542
*/
543-
public function mergePostValidator(sfValidatorBase $validator = null)
543+
public function mergePostValidator(?sfValidatorBase $validator = null)
544544
{
545545
if (null === $validator) {
546546
return;

0 commit comments

Comments
 (0)