Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Call to a member function getType() on string in /var/www/html/harleyq/ether-php/src/Ethereum.php on line 102 #4

Closed
marriva opened this issue Sep 5, 2017 · 4 comments

Comments

@marriva
Copy link

marriva commented Sep 5, 2017

@digitaldonkey

ethereumTester.php

Fatal error: Call to a member function getType() on string in /var/www/html/harleyq/ether-php/src/Ethereum.php on line 102

` $args = func_get_args();
if (count($args) && isset($argument_class_names)) {
$this->debug('Arguments', $args);

      // Validate arguments.
      foreach ($args as $i => $arg) {

        if ($argument_class_names[$i] !== $arg->getType()) {
          throw new \InvalidArgumentException("Argument $i is " . $arg->getType() . " but expected $argument_class_names[$i] in $method().");
        }
        else {`

how $arg could be EthS object if it is basic function argument?

@digitaldonkey
Copy link
Owner

I don't understand your question nor the Environment.
Can you provide information how to reproduce this issue?
Which Ethereum Client your are using?

@erupakov
Copy link

@marriva maybe this code block can help you, I've resolved the issue:

require_once 'vendor/autoload.php';
use Ethereum\Ethereum;
use Ethereum\EthBlockParam;
use Ethereum\EthD20;
const GETH_URL = 'http://localhost:8545';
$geth= new Ethereum(GETH_URL);
$ethAddr = new EthD20($address);
$balance = $geth->eth_getBalance($ethAddr,new EthBlockParam());

@digitaldonkey
Copy link
Owner

@digitaldonkey
Copy link
Owner

Should be fixed in dev branch now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants