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

RDo() Arguments Throw Error #153

Open
bslayton opened this issue Mar 7, 2017 · 0 comments
Open

RDo() Arguments Throw Error #153

bslayton opened this issue Mar 7, 2017 · 0 comments

Comments

@bslayton
Copy link

bslayton commented Mar 7, 2017

I'm new to this library. Coming from the JS driver here. Am I doing this wrong, or is there a bug here. Can someone confirm?

I'm having an issue passing arguments to RDo().

r\expr(['first' => 'John'])
->RDo('Doe', function($first, $last){
    return $first->merge(['last'=>$last]);
})

This products the following exception.

Type: ReflectionException
Message: Function Doe() does not exist
Filename: /var/www/vendor/danielmewes/php-rql/rdb/DatumConverter.php
Line Number: 179
Backtrace:
File: /var/www/vendor/danielmewes/php-rql/rdb/DatumConverter.php
Line: 179
Function: __construct			
File: /var/www/vendor/danielmewes/php-rql/rdb/Queries/Control/RDo.php
Line: 12
Function: nativeToFunction			
File: /var/www/vendor/danielmewes/php-rql/rdb/ValuedQuery/ValuedQuery.php
Line: 418
Function: queryTest			
File: /var/www/test.php
Line: 101
Function: rDo			

Also, it doesn't work if I change the first argument of RDo to an array, either. And, it produces a slight different exception.

['Doe']
A PHP Error was encountered
Severity: Warning
Message:  ReflectionFunction::__construct() expects parameter 1 to be string, array given
Filename: rdb/DatumConverter.php
Line Number: 179
Backtrace:
File: /var/www/vendor/danielmewes/php-rql/rdb/DatumConverter.php
Line: 179
Function: __construct			
File: /var/www/vendor/danielmewes/php-rql/rdb/Queries/Control/RDo.php
Line: 12
Function: nativeToFunction			
File: /var/www/vendor/danielmewes/php-rql/rdb/ValuedQuery/ValuedQuery.php
Line: 418
Function: queryTest			
File: /var/www/application/test.php
Line: 101
Function: rDo

Thanks,
Ben

@bslayton bslayton changed the title Rdo() Arguments Throw Error RDo() Arguments Throw Error Mar 7, 2017
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

1 participant