Skip to content

Commit

Permalink
Merge pull request #15 from vemaeg/feature/php-8.2-changes
Browse files Browse the repository at this point in the history
Feature/php 8.2 changes
  • Loading branch information
thirsch authored Dec 13, 2022
2 parents 63f1191 + 13bfee2 commit 9d92126
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 15 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
memcached-version:
- "1.6"

Expand Down
15 changes: 12 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ services:
php74:
<<: *services_php54
build:
context: .docker/php74_81
context: .docker/php74_82
args:
PHP_VERSION: '7.4'
MEMCACHE_VERSION: '4.0.5.2'
Expand All @@ -139,7 +139,7 @@ services:
php80:
<<: *services_php54
build:
context: .docker/php74_81
context: .docker/php74_82
args:
PHP_VERSION: '8.0'
MEMCACHE_VERSION: '8.0'
Expand All @@ -149,12 +149,21 @@ services:
php81:
<<: *services_php54
build:
context: .docker/php74_81
context: .docker/php74_82
args:
PHP_VERSION: '8.1'
MEMCACHE_VERSION: '8.0'
APCU_VERSION: ''

php82:
<<: *services_php54
build:
context: .docker/php74_82
args:
PHP_VERSION: '8.2'
MEMCACHE_VERSION: '8.0'
APCU_VERSION: ''


db:
image: mysql:5.5.62
Expand Down
2 changes: 1 addition & 1 deletion lib/command/sfAnsiColorFormatter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function formatSection($section, $text, $size = null, $style = 'INFO')
$style = array_key_exists($style, $this->styles) ? $style : 'INFO';
$width = 9 + strlen($this->format('', $style));

return sprintf(">> %-${width}s %s", $this->format($section, $style), $this->excerpt($text, $size - 4 - (strlen($section) > 9 ? strlen($section) : 9)));
return sprintf(">> %-{$width}s %s", $this->format($section, $style), $this->excerpt($text, $size - 4 - (strlen($section) > 9 ? strlen($section) : 9)));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
*/
class sfDoctrineConnectionListener extends Doctrine_EventListener
{
protected
$connection,
$encoding;

public function __construct($connection, $encoding)
{
$this->connection = $connection;
Expand Down
7 changes: 3 additions & 4 deletions lib/routing/sfRoute.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
* @subpackage routing
* @author Fabien Potencier <[email protected]>
* @version SVN: $Id$
*
* @property $firstOptional int
* @property $segments array
*/
class sfRoute implements Serializable
{
Expand All @@ -37,7 +34,9 @@ class sfRoute implements Serializable
$defaults = array(),
$requirements = array(),
$tokens = array(),
$customToken = false;
$customToken = false,
$firstOptional = null,
$segments = array();

/**
* Constructor.
Expand Down
2 changes: 1 addition & 1 deletion lib/task/help/sfHelpTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected function outputAsText(sfTask $task)
foreach ($task->getArguments() as $argument)
{
$default = null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault())) ? $this->formatter->format(sprintf(' (default: %s)', is_array($argument->getDefault()) ? str_replace("\n", '', print_r($argument->getDefault(), true)): $argument->getDefault()), 'COMMENT') : '';
$messages[] = sprintf(" %-${max}s %s%s", $this->formatter->format($argument->getName(), 'INFO'), $argument->getHelp(), $default);
$messages[] = sprintf(" %-{$max}s %s%s", $this->formatter->format($argument->getName(), 'INFO'), $argument->getHelp(), $default);
}

$messages[] = '';
Expand Down
2 changes: 1 addition & 1 deletion lib/task/help/sfListTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function outputAsText($namespace, $tasks)

$aliases = $task->getAliases() ? $this->formatter->format(' ('.implode(', ', $task->getAliases()).')', 'COMMENT') : '';

$messages[] = sprintf(" %-${width}s %s%s", $this->formatter->format(':'.$task->getName(), 'INFO'), $task->getBriefDescription(), $aliases);
$messages[] = sprintf(" %-{$width}s %s%s", $this->formatter->format(':'.$task->getName(), 'INFO'), $task->getBriefDescription(), $aliases);
}

$this->log($messages);
Expand Down
2 changes: 1 addition & 1 deletion lib/task/project/sfProjectPermissionsTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function chmod($file, $mode, $umask = 0000)
*
* @see http://www.php.net/set_error_handler
*/
public function handleError($no, $string, $file, $line, $context)
public function handleError($no, $string, $file, $line, $context = null)
{
$this->failed[] = $this->current;
}
Expand Down
4 changes: 3 additions & 1 deletion lib/task/sfBaseTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ abstract class sfBaseTask extends sfCommandApplicationTask
protected
$configuration = null,
$pluginManager = null,
$statusStartTime = null;
$statusStartTime = null,
$filesystem = null,
$tokens = array();

/**
* @see sfTask
Expand Down
3 changes: 2 additions & 1 deletion lib/util/sfBrowser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class sfBrowser extends sfBrowserBase
protected
$listeners = array(),
$context = null,
$currentException = null;
$currentException = null,
$rawConfiguration = array();

/**
* Calls a request to a uri.
Expand Down
4 changes: 2 additions & 2 deletions lib/yaml/sfYamlInline.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static protected function dumpArray($value)
*/
static public function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true)
{
if (in_array($scalar[$i], $stringDelimiters))
if (is_string($scalar) && in_array($scalar[$i], $stringDelimiters))
{
// quoted scalar
$output = self::parseQuotedScalar($scalar, $i);
Expand Down Expand Up @@ -272,7 +272,7 @@ static protected function parseSequence($sequence, &$i = 0)
$isQuoted = in_array($sequence[$i], array('"', "'"));
$value = self::parseScalar($sequence, array(',', ']'), array('"', "'"), $i);

if (!$isQuoted && false !== strpos($value, ': '))
if (!$isQuoted && false !== strpos((string) $value, ': '))
{
// embedded mapping?
try
Expand Down

0 comments on commit 9d92126

Please sign in to comment.