Merge pull request #10295 from nupplaphil/bug/php7_cs
Fix PHP 7.0 Coding Standards
This commit is contained in:
commit
0238a15809
|
@ -127,8 +127,8 @@ class TagCloud
|
|||
private static function tagCalc(array $arr)
|
||||
{
|
||||
$tags = [];
|
||||
$min = 1e9;
|
||||
$max = -1e9;
|
||||
$min = 1000000000.0;
|
||||
$max = -1000000000.0;
|
||||
$x = 0;
|
||||
|
||||
if (!$arr) {
|
||||
|
@ -145,7 +145,7 @@ class TagCloud
|
|||
}
|
||||
|
||||
usort($tags, 'self::tagsSort');
|
||||
$range = max(.01, $max - $min) * 1.0001;
|
||||
$range = max(0.01, $max - $min) * 1.0001;
|
||||
|
||||
for ($x = 0; $x < count($tags); $x ++) {
|
||||
$tags[$x][2] = 1 + floor(9 * ($tags[$x][1] - $min) / $range);
|
||||
|
|
|
@ -70,7 +70,7 @@ class HTTPRequest implements IHTTPRequest
|
|||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function get(string $url, array $opts = [], int &$redirects = 0)
|
||||
public function get(string $url, array $opts = [], &$redirects = 0)
|
||||
{
|
||||
$stamp1 = microtime(true);
|
||||
|
||||
|
@ -222,7 +222,7 @@ class HTTPRequest implements IHTTPRequest
|
|||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function post(string $url, $params, array $headers = [], int $timeout = 0, int &$redirects = 0)
|
||||
public function post(string $url, $params, array $headers = [], int $timeout = 0, &$redirects = 0)
|
||||
{
|
||||
$stamp1 = microtime(true);
|
||||
|
||||
|
@ -447,7 +447,7 @@ class HTTPRequest implements IHTTPRequest
|
|||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function fetch(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
|
||||
public function fetch(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', &$redirects = 0)
|
||||
{
|
||||
$ret = $this->fetchFull($url, $timeout, $accept_content, $cookiejar, $redirects);
|
||||
|
||||
|
@ -461,7 +461,7 @@ class HTTPRequest implements IHTTPRequest
|
|||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function fetchFull(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
|
||||
public function fetchFull(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', &$redirects = 0)
|
||||
{
|
||||
return $this->get(
|
||||
$url,
|
||||
|
|
|
@ -114,7 +114,8 @@ class Status extends BaseDataTransferObject
|
|||
$this->visibility = $visibility[$item['private']];
|
||||
|
||||
$languages = json_decode($item['language'], true);
|
||||
$this->language = is_array($languages) ? array_key_first($languages) : null;
|
||||
reset($languages);
|
||||
$this->language = is_array($languages) ? key($languages) : null;
|
||||
|
||||
$this->uri = $item['uri'];
|
||||
$this->url = $item['plink'] ?? null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user