* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatch(string $eventName, Event $event = null)
public function dispatch(string $eventName, Event $event = null): int
{
if (null === $event) {
$event = new Event($eventName);
@ -115,7 +115,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatchScript(string $eventName, bool $devMode = false, array $additionalArgs = array(), array $flags = array())
public function dispatchScript(string $eventName, bool $devMode = false, array $additionalArgs = array(), array $flags = array()): int
{
assert($this->composer instanceof Composer, new \LogicException('This should only be reached with a fully loaded Composer'));
@ -134,7 +134,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatchPackageEvent(string $eventName, bool $devMode, RepositoryInterface $localRepo, array $operations, OperationInterface $operation)
public function dispatchPackageEvent(string $eventName, bool $devMode, RepositoryInterface $localRepo, array $operations, OperationInterface $operation): int
{
assert($this->composer instanceof Composer, new \LogicException('This should only be reached with a fully loaded Composer'));
@ -152,7 +152,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatchInstallerEvent(string $eventName, bool $devMode, bool $executeOperations, Transaction $transaction)
public function dispatchInstallerEvent(string $eventName, bool $devMode, bool $executeOperations, Transaction $transaction): int
{
assert($this->composer instanceof Composer, new \LogicException('This should only be reached with a fully loaded Composer'));
@ -342,7 +342,7 @@ class EventDispatcher
*
* @return int
*/
protected function executeTty(string $exec)
protected function executeTty(string $exec): int
{
if ($this->io->isInteractive()) {
return $this->process->executeTty($exec);
@ -354,7 +354,7 @@ class EventDispatcher
/**
* @return string
*/
protected function getPhpExecCommand()
protected function getPhpExecCommand(): string
{
$finder = new PhpExecutableFinder();
$phpPath = $finder->find(false);
@ -397,7 +397,7 @@ class EventDispatcher
*
* @return void
*/
public function addListener(string $eventName, callable $listener, int $priority = 0)
public function addListener(string $eventName, callable $listener, int $priority = 0): void
* Defines package metadata that is not necessarily needed for solving and installing packages
*
* PackageInterface & derivatives are considered internal, you may use them in type hints but extending/implementing them is not recommended and not supported. Things may change without notice.
@ -17,6 +17,8 @@ use Composer\Repository\RepositoryInterface;
/**
* Defines the essential information a package has that is used during solving/installation
*
* PackageInterface & derivatives are considered internal, you may use them in type hints but extending/implementing them is not recommended and not supported. Things may change without notice.
* Defines additional fields that are only needed for the root package
*
* PackageInterface & derivatives are considered internal, you may use them in type hints but extending/implementing them is not recommended and not supported. Things may change without notice.
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*
* @phpstan-import-type AutoloadRules from PackageInterface
@ -59,7 +59,7 @@ class GitBitbucketDriver extends VcsDriver
/**
* @inheritDoc
*/
public function initialize()
public function initialize(): void
{
if (!Preg::isMatch('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)?$#i', $this->url, $match)) {
throw new \InvalidArgumentException(sprintf('The Bitbucket repository URL %s is invalid. It must be the HTTPS URL of a Bitbucket repository.', $this->url));
@ -83,7 +83,7 @@ class GitBitbucketDriver extends VcsDriver
/**
* @inheritDoc
*/
public function getUrl()
public function getUrl(): string
{
if ($this->fallbackDriver) {
return $this->fallbackDriver->getUrl();
@ -99,7 +99,7 @@ class GitBitbucketDriver extends VcsDriver