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

Fix doc on create new post on source code #19

Merged
merged 1 commit into from
Aug 19, 2015

Conversation

deerawan
Copy link
Contributor

I got an error when following the documentation for this part below:

$route = 'foo/bar';
$data = ['param1' => 'foo', 'param2' => 'bar'];
Yii::$app->queue->post(new Job($route, $data));

The error said

PHP Warning – yii\base\ErrorException

Invalid argument supplied for foreach()

1. in /Users/masbugan/Sites/gado/yiisoft/yii2/BaseYii.php at line517
508509510511512513514515516517518519520521522523524525526


    /**
     * Configures an object with the initial property values.
     * @param object $object the object to be configured
     * @param array $properties the property initial values given in terms of name-value pairs.
     * @return object the object itself
     */
    public static function configure($object, $properties)
    {
        foreach ($properties as $name => $value) {
            $object->$name = $value;
        }

        return $object;
    }

    /**
     * Returns the public member variables of an object.
     * This method is provided such that we can get the public member variables of an object.

2. in /Users/masbugan/Sites/gado/vendor/yiisoft/yii2/BaseYii.php – yii\base\ErrorHandler::handleError(2, 'Invalid argument supplied for fo...', '/Users/masbugan/Sites/gado-...', 517, ...)at line517
3. in /Users/masbugan/Sites/gado/vendor/yiisoft/yii2/base/Object.php – yii\BaseYii::configure(UrbanIndo\Yii2\Queue\Job, 'foo/bar')at line105

The last line is supposed to be

Yii::$app->queue->post(new Job(['route' => $route, 'data' => $data]));

petrabarus added a commit that referenced this pull request Aug 19, 2015
Fix doc on create new post on source code
@petrabarus petrabarus merged commit 38ca6b3 into urbanindo:master Aug 19, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants