for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* hirak/prestissimo
* @author Hiraku NAKANO
* @license MIT https://github.com/hirak/prestissimo
*/
namespace Hirak\Prestissimo\Aspects;
use Composer\IO;
/**
* Simple Container for http-get request
* GitHub edition
class GitHubRequest extends HttpGetRequest
{
const TOKEN_LABEL = 'github-token';
public function __construct($origin, $url, IO\IOInterface $io)
parent::__construct($origin, $url, $io);
if ($this->password === 'x-oauth-basic') {
$this->query['access_token'] = $this->username;
// forbid basic-auth
$this->username = $this->password = null;
}
public function getURL()
return preg_replace(
'%^https://api\.github\.com/repos(/[^/]+/[^/]+/)zipball(.*)%',
'https://codeload.github.com$1legacy.zip$2',
parent::getURL()
);
public function promptAuth(HttpGetResponse $res, IO\IOInterface $io)
$util = new \Composer\Util\GitHub($io, $this->config, null);
$this->promptAuthWithUtil(404, $util, $res, $io);
$util
object<Composer\Util\GitHub>
object<Composer\Composer...r\Composer\Util\GitLab>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: