Pyrech\ComposerChangelogs\OperationHandler\InstallHandler::extractSourceUrl PHP Метод

extractSourceUrl() публичный Метод

public extractSourceUrl ( Composer\DependencyResolver\Operation\OperationInterface $operation )
$operation Composer\DependencyResolver\Operation\OperationInterface
    public function extractSourceUrl(OperationInterface $operation)
    {
        if (!$operation instanceof InstallOperation) {
            throw new \LogicException('Operation should be an instance of InstallOperation');
        }
        return $operation->getPackage()->getSourceUrl();
    }

Usage Example

 /**
  * @expectedException \LogicException
  * @expectedExceptionMessage Operation should be an instance of InstallOperation
  */
 public function test_it_throws_exception_when_extracting_source_url_from_non_install_operation()
 {
     $this->SUT->extractSourceUrl(new FakeOperation(''));
 }