Skip to content

Commit

Permalink
minor #981 fix: deprecations triggered by debug class loader (shyim)
Browse files Browse the repository at this point in the history
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead.

Discussion
----------

fix: deprecations triggered by debug class loader

Fixes following errors:

```
21:05:05 INFO      [php] User Deprecated: Method "Composer\Plugin\PluginInterface::activate()" might add "void" as a native return type declaration in the future. Do the same in implementation "Symfony\Flex\Flex" now to avoid errors or add an explicit `@return` annotation to suppress this message.
21:05:05 INFO      [php] User Deprecated: Method "Composer\Plugin\PluginInterface::deactivate()" might add "void" as a native return type declaration in the future. Do the same in implementation "Symfony\Flex\Flex" now to avoid errors or add an explicit `@return` annotation to suppress this message.
21:05:05 INFO      [php] User Deprecated: Method "Composer\Plugin\PluginInterface::uninstall()" might add "void" as a native return type declaration in the future. Do the same in implementation "Symfony\Flex\Flex" now to avoid errors or add an explicit `@return` annotation to suppress this message.
21:05:05 INFO      [php] User Deprecated: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Symfony\Flex\Response" now to avoid errors or add an explicit `@return` annotation to suppress this message.
21:05:05 INFO      [php] User Deprecated: Method "Composer\DependencyResolver\Operation\OperationInterface::getOperationType()" might add "string" as a native return type declaration in the future. Do the same in implementation "Symfony\Flex\InformationOperation" now to avoid errors or add an explicit `@return` annotation to suppress this message.
21:05:05 INFO      [php] User Deprecated: Method "Composer\DependencyResolver\Operation\OperationInterface::show()" might add "string" as a native return type declaration in the future. Do the same in implementation "Symfony\Flex\InformationOperation" now to avoid errors or add an explicit `@return` annotation to suppress this message.
```

Commits
-------

67ddf63 fix: deprecations triggered by debug class loader
  • Loading branch information
fabpot committed Aug 3, 2023
2 parents 039bb47 + 67ddf63 commit 1a482f5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ class Flex implements PluginInterface, EventSubscriberInterface
];
private $filter;

/**
* @return void
*/
public function activate(Composer $composer, IOInterface $io)
{
if (!\extension_loaded('openssl')) {
Expand Down Expand Up @@ -291,6 +294,9 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
}
}

/**
* @return void
*/
public function deactivate(Composer $composer, IOInterface $io)
{
self::$activated = false;
Expand Down Expand Up @@ -594,6 +600,9 @@ private function synchronizePackageJson(string $rootDir)
}
}

/**
* @return void
*/
public function uninstall(Composer $composer, IOInterface $io)
{
$this->lock->delete();
Expand Down
4 changes: 4 additions & 0 deletions src/InformationOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function getJobType()

/**
* {@inheritdoc}
*
* @return string
*/
public function getOperationType()
{
Expand All @@ -65,6 +67,8 @@ public function getOperationType()

/**
* {@inheritdoc}
*
* @return string
*/
public function show($lock)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public static function fromJson(array $json): self
return $response;
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
Expand Down

0 comments on commit 1a482f5

Please sign in to comment.