Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
245c7cc
PHP 8.1 > internal_method_return_types
Tybaze May 19, 2022
6401fcc
PHP 8.1 > Serializable Phase Out
Tybaze May 19, 2022
029b0e7
PHP 8.0 & 8.1 > Deprecated of null to non-nullable internal function …
Tybaze May 23, 2022
dcb1ce3
PHP 8.1 > strftime deprecated.
Tybaze May 23, 2022
8450b13
PHP 8.1 > Unit Test
Tybaze Jun 9, 2022
9cb7fb4
Fix lime message: "An uncaught exception has been thrown" do not have…
Tybaze Jun 9, 2022
25a5e71
PHP 8.1 > uasort(): Returning bool from comparison function is deprec…
Tybaze Jun 9, 2022
09fc710
Fix ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must n…
Tybaze Jun 9, 2022
df2ec65
PHP 8.0 > fread()/count() behavior
Tybaze Jun 9, 2022
42112ab
Fix Declaration of sfPearRestTest::downloadHttp($url, $lastmodified =…
Tybaze Jun 9, 2022
29ab2a7
PHP 8.0 > mktime update
Tybaze Jun 9, 2022
12f7b4c
Fix sfWebResponse->getContentType() return a string not an array
Tybaze Jun 10, 2022
cae793e
Fix sfDoctrineTester, string cannot be accessed as array
Tybaze Jun 10, 2022
7341b43
PHP 8.0 > Fix is_numeric behavior with trailing empty char
Tybaze Jun 10, 2022
b191cb8
PHP 8.0 > String to Number Comparison.
Tybaze Jun 10, 2022
956cb1a
PHP 8.1 > Change support to PHP 8.1
Tybaze May 23, 2022
b0cb92e
Fix UnitTest application/x-sharedlib
Tybaze Jun 10, 2022
bb22141
PHP 8.1 > mysqli_report revert to off
Tybaze Jun 10, 2022
d0d0d12
Refactor code and apply Coding Style fixes
Tybaze Jul 7, 2022
01fadb9
PHP 8.1 > Better MYSQLI_REPORT_OFF implementations for php8.1 compat
Tybaze Aug 2, 2022
3bb8339
PHP 8.1 > remove full_path from uploads added on PHP v8.1
mentalstring Aug 12, 2022
7798328
Fix use of null on string parameter on multiple classes
mentalstring Aug 12, 2022
1e9b188
Github Actions: enable testing on PHP v8.0 and v8.1 (for PRs too)
thePanz Nov 25, 2022
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
10 changes: 7 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: "Continuous Integration"

on: [push]
on:
push:
branches:
- master
pull_request:

env:
fail-fast: true
Expand All @@ -14,8 +18,8 @@ jobs:
matrix:
php-version:
- "7.4"
# - "8.0"
# - "8.1"
- "8.0"
- "8.1"
memcached-version:
- "1.6"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ All the enhancements and BC breaks are listed in the [WHATS_NEW](https://github.

- [DIC](https://github.com/FriendsOfSymfony1/symfony1/wiki/ServiceContainer)
- Composer support
- PHP 7.2 support
- PHP 8.1 support
- performance boost
- new widgets & validators
- some tickets fixed from the symfony trac
Expand Down
6 changes: 6 additions & 0 deletions lib/addon/sfPager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ protected function resetIterator()
*
* @see Iterator
*/
#[\ReturnTypeWillChange]
public function current()
{
if (!$this->isIteratorInitialized())
Expand All @@ -544,6 +545,7 @@ public function current()
*
* @see Iterator
*/
#[\ReturnTypeWillChange]
public function key()
{
if (!$this->isIteratorInitialized())
Expand All @@ -559,6 +561,7 @@ public function key()
*
* @see Iterator
*/
#[\ReturnTypeWillChange]
public function next()
{
if (!$this->isIteratorInitialized())
Expand All @@ -576,6 +579,7 @@ public function next()
*
* @see Iterator
*/
#[\ReturnTypeWillChange]
public function rewind()
{
if (!$this->isIteratorInitialized())
Expand All @@ -593,6 +597,7 @@ public function rewind()
*
* @see Iterator
*/
#[\ReturnTypeWillChange]
public function valid()
{
if (!$this->isIteratorInitialized())
Expand All @@ -608,6 +613,7 @@ public function valid()
*
* @see Countable
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->getNbResults();
Expand Down
10 changes: 9 additions & 1 deletion lib/cache/sfFileCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,15 @@ protected function read($path, $type = self::READ_DATA)
fseek($fp, 0, SEEK_END);
$length = ftell($fp) - 24;
fseek($fp, 24);
$data[self::READ_DATA] = @fread($fp, $length);

if ($length > 0)
{
$data[self::READ_DATA] = @fread($fp, $length);
}
else
{
$data[self::READ_DATA] = '';
}
}
}
else
Expand Down
12 changes: 12 additions & 0 deletions lib/database/sfMySQLiDatabase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
class sfMySQLiDatabase extends sfMySQLDatabase
{

/**
* @return void
* @throws sfDatabaseException
*/
public function connect()
{
// PHP 8.1 Activate Exception per default, revert behavior to "return false"
mysqli_report(MYSQLI_REPORT_OFF);

parent::connect();
}

/**
* Returns the appropriate connect method.
*
Expand Down
10 changes: 10 additions & 0 deletions lib/escaper/sfOutputEscaperArrayDecorator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function __construct($escapingMethod, $value)
/**
* Reset the array to the beginning (as required for the Iterator interface).
*/
#[\ReturnTypeWillChange]
public function rewind()
{
reset($this->value);
Expand All @@ -54,6 +55,7 @@ public function rewind()
*
* @return string The key
*/
#[\ReturnTypeWillChange]
public function key()
{
return key($this->value);
Expand All @@ -67,6 +69,7 @@ public function key()
*
* @return mixed The escaped value
*/
#[\ReturnTypeWillChange]
public function current()
{
return sfOutputEscaper::escape($this->escapingMethod, current($this->value));
Expand All @@ -75,6 +78,7 @@ public function current()
/**
* Moves to the next element (as required by the Iterator interface).
*/
#[\ReturnTypeWillChange]
public function next()
{
next($this->value);
Expand All @@ -91,6 +95,7 @@ public function next()
*
* @return bool The validity of the current element; true if it is valid
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->count > 0;
Expand All @@ -103,6 +108,7 @@ public function valid()
*
* @return bool true if the offset isset; false otherwise
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->value[$offset]);
Expand All @@ -115,6 +121,7 @@ public function offsetExists($offset)
*
* @return mixed The escaped value
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return sfOutputEscaper::escape($this->escapingMethod, $this->value[$offset]);
Expand All @@ -132,6 +139,7 @@ public function offsetGet($offset)
*
* @throws sfException
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new sfException('Cannot set values.');
Expand All @@ -148,6 +156,7 @@ public function offsetSet($offset, $value)
*
* @throws sfException
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new sfException('Cannot unset values.');
Expand All @@ -158,6 +167,7 @@ public function offsetUnset($offset)
*
* @return int The size of the array
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->value);
Expand Down
9 changes: 9 additions & 0 deletions lib/escaper/sfOutputEscaperIteratorDecorator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function __construct($escapingMethod, Traversable $value)
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
return $this->iterator->rewind();
Expand All @@ -66,6 +67,7 @@ public function rewind()
*
* @return mixed The escaped value
*/
#[\ReturnTypeWillChange]
public function current()
{
return sfOutputEscaper::escape($this->escapingMethod, $this->iterator->current());
Expand All @@ -76,6 +78,7 @@ public function current()
*
* @return string Iterator key
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->iterator->key();
Expand All @@ -86,6 +89,7 @@ public function key()
*
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
return $this->iterator->next();
Expand All @@ -97,6 +101,7 @@ public function next()
*
* @return bool true if the current element is valid; false otherwise
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->iterator->valid();
Expand All @@ -109,6 +114,7 @@ public function valid()
*
* @return bool true if the offset isset; false otherwise
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->value[$offset]);
Expand All @@ -121,6 +127,7 @@ public function offsetExists($offset)
*
* @return mixed The escaped value
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return sfOutputEscaper::escape($this->escapingMethod, $this->value[$offset]);
Expand All @@ -138,6 +145,7 @@ public function offsetGet($offset)
*
* @throws sfException
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new sfException('Cannot set values.');
Expand All @@ -154,6 +162,7 @@ public function offsetSet($offset, $value)
*
* @throws sfException
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new sfException('Cannot unset values.');
Expand Down
10 changes: 8 additions & 2 deletions lib/escaper/sfOutputEscaperObjectDecorator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,18 @@ public function __isset($key)
/**
* Returns the size of the object if it implements Countable (is required by the Countable interface).
*
* It returns 1 if other cases (which is the default PHP behavior in such a case).
* It returns 1 if other cases (which was the default PHP behavior in such a case before php 7.3).
*
* @return int The size of the object
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->value);
// See https://github.com/symfony/polyfill/commit/d330c0094a47d8edceeea1ed553d6e08215a9fc2
if (is_array($this->value) || $this->value instanceof Countable || $this->value instanceof ResourceBundle || $this->value instanceof SimpleXmlElement)
{
return count($this->value);
}
return 1;
}
}
6 changes: 5 additions & 1 deletion lib/event/sfEvent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getReturnValue()
/**
* Sets the processed flag.
*
* @param Boolean $processed The processed flag value
* @param bool $processed The processed flag value
*/
public function setProcessed($processed)
{
Expand Down Expand Up @@ -117,6 +117,7 @@ public function getParameters()
*
* @return Boolean true if the parameter exists, false otherwise
*/
#[\ReturnTypeWillChange]
public function offsetExists($name)
{
return array_key_exists($name, $this->parameters);
Expand All @@ -129,6 +130,7 @@ public function offsetExists($name)
*
* @return mixed The parameter value
*/
#[\ReturnTypeWillChange]
public function offsetGet($name)
{
if (!array_key_exists($name, $this->parameters))
Expand All @@ -145,6 +147,7 @@ public function offsetGet($name)
* @param string $name The parameter name
* @param mixed $value The parameter value
*/
#[\ReturnTypeWillChange]
public function offsetSet($name, $value)
{
$this->parameters[$name] = $value;
Expand All @@ -155,6 +158,7 @@ public function offsetSet($name, $value)
*
* @param string $name The parameter name
*/
#[\ReturnTypeWillChange]
public function offsetUnset($name)
{
unset($this->parameters[$name]);
Expand Down
6 changes: 6 additions & 0 deletions lib/exception/sfException.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ static protected function formatArrayAsHtml($values)
*/
static protected function fileExcerpt($file, $line)
{
// $file can be null for RuntimeException
if (null === $file)
{
return '';
}

if (is_readable($file))
{
$content = preg_split('#<br />#', preg_replace('/^<code>(.*)<\/code>$/s', '$1', highlight_file($file, true)));
Expand Down
Loading