8000 apply cs fix · connorhu/symfony1@9c1aef6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c1aef6

Browse files
committed
apply cs fix
1 parent 4c5c8a2 commit 9c1aef6

File tree

46 files changed

+89
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+89
-89
lines changed

lib/autoload/sfCoreAutoload.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ public static function make()
510510
$classes = '';
511511
foreach ($files as $file) {
512512
$file = str_replace(DIRECTORY_SEPARATOR, '/', $file);
513-
$class = basename($file, false === strpos($file, '.class.php') ? '.php' : '.class.php');
513+
$class = basename($file, !str_contains($file, '.class.php') ? '.php' : '.class.php');
514514

515515
$contents = file_get_contents($file);
516516
if (false !== stripos($contents, 'class '.$class)

lib/cache/sfFileCache.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function remove($key)
101101
*/
102102
public function removePattern($pattern)
103103
{
104-
if (false !== strpos($pattern, '**')) {
104+
if (str_contains($pattern, '**')) {
105105
$pattern = str_replace(sfCache::SEPARATOR, DIRECTORY_SEPARATOR, $pattern).self::EXTENSION;
106106

107107
$regexp = self::patternToRegexp($pattern);

lib/command/sfCommandApplication.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ protected function fixCgi()
557557
ini_set('html_errors', false);
558558
ini_set('magic_quotes_runtime', false);
559559

560-
if (false === strpos(PHP_SAPI, 'cgi')) {
560+
if (!str_contains(PHP_SAPI, 'cgi')) {
561561
return;
562562
}
563563

lib/command/sfCommandManager.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ protected function parseShortOption($argument)
316316
*/
317317
protected function parseLongOption($argument)
318318
{
319-
if (false !== strpos($argument, '=')) {
319+
if (str_contains($argument, '=')) {
320320
list($name, $value) = explode('=', $argument, 2);
321321

322322
if (!$this->optionSet->hasOption($name)) {

lib/config/sfRoutingConfigHandler.class.php

Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function parse($configFiles)
8989
foreach ($config as $name => $params) {
9090
if (
9191
(isset($params['type']) && 'collection' == $params['type'])
92-
|| (isset($params['class']) && false !== strpos($params['class'], 'Collection'))
92+
|| (isset($params['class']) && str_contains($params['class'], 'Collection'))
9393
) {
9494
$options = isset($params['options']) ? $params['options'] : [];
9595
$options['name'] = $name;

lib/controller/sfWebController.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function genUrl($parameters = [], $absolute = false)
3737
}
3838

3939
// relative URL?
40-
if (0 === strpos($parameters, '/')) {
40+
if (str_starts_with($parameters, '/')) {
4141
return $parameters;
4242
}
4343

@@ -109,7 +109,7 @@ public function convertUrlStringToParameters($url)
109109
// routeName?
110110
if ($url && '@' == $url[0]) {
111111
$route = substr($url, 1);
112-
} elseif (false !== strpos($url, '/')) {
112+
} elseif (str_contains($url, '/')) {
113113
list($params['module'], $params['action']) = explode('/', $url);
114114
} elseif (!$queryString) {
115115
$route = $givenUrl;

lib/debug/sfDebug.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public static function shortenFilePath($file)
238238
}
239239

240240
foreach (['sf_root_dir', 'sf_symfony_lib_dir'] as $key) {
241-
if (0 === strpos($file, $value = sfConfig::get($key))) {
241+
if (str_starts_with($file, $value = sfConfig::get($key))) {
242242
$file = str_replace($value, strtoupper($key), $file);
243243

244244
break;

lib/debug/sfWebDebugPanel.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function getToggleableDebugStack($debugStack)
115115
$file = isset($trace['file']) ? $trace['file'] : null;
116116
$line = isset($trace['line']) ? $trace['line'] : null;
117117

118-
$isProjectFile = $file && 0 === strpos($file, sfConfig::get('sf_root_dir')) && !preg_match('/(cache|plugins|vendor)/', $file);
118+
$isProjectFile = $file && str_starts_with($file, sfConfig::get('sf_root_dir')) && !preg_match('/(cache|plugins|vendor)/', $file);
119119

120120
$html .= sprintf('<span%s>#%s &raquo; ', $isProjectFile ? ' class="sfWebDebugHighlight"' : '', $keys[$j] + 1);
121121

lib/debug/sfWebDebugPanelCache.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function getTitleUrl()
2525
{
2626
$queryString = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
2727

28-
if (false === strpos($queryString, '_sf_ignore_cache')) {
28+
if (!str_contains($queryString, '_sf_ignore_cache')) {
2929
return sprintf('?%s_sf_ignore_cache=1', $queryString ? $queryString.'&' : '');
3030
}
3131

lib/debug/sfWebDebugPanelLogs.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected function formatLogLine($logLine)
108108
$logLine = $this->formatSql($logLine);
109109

110110
// remove username/password from DSN
111-
if (false !== strpos($logLine, 'DSN')) {
111+
if (str_contains($logLine, 'DSN')) {
112112
$logLine = preg_replace("/=&gt;\\s+'?[^'\\s,]+'?/", "=&gt; '****'", $logLine);
113113
}
114114

0 commit comments

Comments
 (0)
0