diff --git a/README.md b/README.md index 7a1c537..bdfdf5c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ How to run tests? ----------------- ``` - + php bin/phpunit ``` @@ -50,25 +50,25 @@ Smart codes have to be bound to a payload this can be done by implementing the P ``` use Intracto\SmartCodeBundle\Entity\PayloadInterface; use Intracto\SmartCodeBundle\Entity\SmartCodeInterface; - + class Payload implements PayloadInterface { ... - + /** * @ORM\OneToMany(targetEntity="Intracto\SmartCodeBundle\Entity\SmartCodeInterface", mappedBy="payload") * * @var SmartCodes[]|ArrayCollection */ protected $smartCodes; - + ... } ``` Now you can get started with the generation. To generate Smart codes you can use the SmartCodeGenerator -or create your own by implementing the SmartCodeGeneratorInterface. +or create your own by implementing the SmartCodeGeneratorInterface. This service will allow you to call the function: @@ -77,7 +77,7 @@ This service will allow you to call the function: ``` As you can see this has 2 parameters, the first is your payload that you created in step 1 and the 2nd is a model -containing all your options. +containing all your options. ``` class SmartCodeOptions @@ -87,7 +87,7 @@ containing all your options. protected $expiresAt; protected $startsAt; protected $batch; - + ... } ``` @@ -100,16 +100,16 @@ containing all your options. The last thing you would probably want to do is to be able to use these smart codes you just generated. This is possible via the SmartCodeAction service, which you can also overwrite by implementing the SmartCodeActionInterface. - + This class has 2 required functions: ``` public function register(SubjectInterface $subject, SmartCodeInterface $smartCode); - + public function unregister(SubjectInterface $subject, SmartCodeInterface $smartCode); ``` -To register or unregister a certain smart code you would need a subject that is going to be using this code. +To register or unregister a certain smart code you would need a subject that is going to be using this code. To make such a subject you can implement the SubjectInterface. ``` @@ -118,9 +118,9 @@ To make such a subject you can implement the SubjectInterface. class User implements SubjectInterface { - + ... - + /** * @ORM\ManyToMany(targetEntity="Intracto\SmartCodeBundle\Entity\SmartCodeInterface", inversedBy="subjects") * @ORM\JoinTable(name="user_smartcode", @@ -131,9 +131,9 @@ To make such a subject you can implement the SubjectInterface. * @var SmartCode[]|ArrayCollection */ protected $smartCodes; - + ... - + } ``` diff --git a/composer.json b/composer.json index a58ba99..d3ad09e 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ ], "require": { - "php": ">=5.3.9", - "doctrine/orm": "~2.2", - "symfony/framework-bundle": "~2.3", - "symfony/validator": "~2.3" + "php": ">=7.2", + "doctrine/orm": "~2.4", + "symfony/framework-bundle": "~3.4", + "symfony/validator": "~3.4" }, "config": { @@ -32,4 +32,4 @@ }, "target-dir": "Intracto/SmartCodeBundle" -} \ No newline at end of file +}