Skip to content

Instantly share code, notes, and snippets.

@semihkeskindev
Last active December 4, 2019 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semihkeskindev/768b63b16d96766bf099128b2c8fa42b to your computer and use it in GitHub Desktop.
Save semihkeskindev/768b63b16d96766bf099128b2c8fa42b to your computer and use it in GitHub Desktop.
serialization class
<?php
use klass\a\UserRegistrationJob;
$app = new UserRegistrationJob('semih', 'keskin');
$serialize = serialize($app);
return unserialize($serialize);
<?php
require __DIR__.'/UserRegistrationJob.php';
$app = require __DIR__.'/execute.php';
<?php
namespace klass\a;
class UserRegistrationJob implements \JsonSerializable
{
private $name;
private $surname;
public function __construct($name,$surname)
{
$this->name = $name;
$this->surname = $surname;
}
public function handle()
{
}
public function __wakeup()
{
$this->handle();
}
public function jsonSerialize()
{
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment